* . *
  • About
  • Advertise
  • Privacy & Policy
  • Contact
Monday, June 16, 2025
Earth-News
  • Home
  • Business
  • Entertainment
    Elisabeth Moss’ ‘Handmaid’s Tale’ Emmy chances, by the numbers – Yahoo

    Elisabeth Moss’ ‘Handmaid’s Tale’ Emmy chances, by the numbers – Yahoo

    ‘Gangs of London’ Producer Explains Season 3 Deaths, Hypes Season 4 – Citizen Tribune

    Gangs of London’ Producer Reveals Shocking Season 3 Deaths and Teases Exciting Season 4

    The Iconic Missouri Diner That Gives You A Taste Of Live Entertainment With Your Meal – Yahoo

    Savor Delicious Meals While Enjoying Live Entertainment at Missouri’s Iconic Diner

    Keke Palmer Revealed How She Came Up With Her Son Leodis’ Name – Yahoo

    Keke Palmer Shares the Heartwarming Story Behind Her Son Leodis’ Name

    The Media and Entertainment Deal Machine Is Revving Up – WSJ

    The Media and Entertainment Deal Machine Is Gearing Up for Action

    Op-Ed: Data Storage and Protection in Today’s Media & Entertainment Industry – Sports Video Group

    How Data Storage and Protection Are Transforming the Media & Entertainment Industry

  • General
  • Health
  • News

    Cracking the Code: Why China’s Economic Challenges Aren’t Shaking Markets, Unlike America’s” – Bloomberg

    Trump’s Narrow Window to Spread the Truth About Harris

    Trump’s Narrow Window to Spread the Truth About Harris

    Israel-Gaza war live updates: Hamas leader Ismail Haniyeh assassinated in Iran, group says

    Israel-Gaza war live updates: Hamas leader Ismail Haniyeh assassinated in Iran, group says

    PAP Boss to Niger Delta Youths, Stay Away from the Protest

    PAP Boss to Niger Delta Youths, Stay Away from the Protest

    Court Restricts Protests In Lagos To Freedom, Peace Park

    Court Restricts Protests In Lagos To Freedom, Peace Park

    Fans React to Jazz Jennings’ Inspiring Weight Loss Journey

    Fans React to Jazz Jennings’ Inspiring Weight Loss Journey

    Trending Tags

    • Trump Inauguration
    • United Stated
    • White House
    • Market Stories
    • Election Results
  • Science
  • Sports
  • Technology
    Further Upside For Aeries Technology, Inc (NASDAQ:AERT) Shares Could Introduce Price Risks After 27% Bounce – simplywall.st

    Further Upside For Aeries Technology, Inc (NASDAQ:AERT) Shares Could Introduce Price Risks After 27% Bounce – simplywall.st

    Editor’s Pick: 9 Books on Technology – The Gospel Coalition

    9 Must-Read Books That Will Completely Transform How You Understand Technology

    New Semiconductor Technology Could Supercharge 6G Delivery – SciTechDaily

    Revolutionary Semiconductor Technology Set to Turbocharge 6G Connectivity

    UTC To Host Quantum Technology Workshop June 23-25 – Chattanoogan.com: Breaking News

    Join the Quantum Technology Workshop This June 23-25!

    Rimac Technology Powers the Bugatti Tourbillon with Cutting-Edge Battery and Powertrain Tech – Rimac Newsroom

    Rimac Technology Drives the Bugatti Tourbillon with Revolutionary Battery and Powertrain Innovation

    “Co-creation” boosts commercial technology for dual-use defense applications – Breaking Defense

    “Co-creation” boosts commercial technology for dual-use defense applications – Breaking Defense

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
No Result
View All Result
  • Home
  • Business
  • Entertainment
    Elisabeth Moss’ ‘Handmaid’s Tale’ Emmy chances, by the numbers – Yahoo

    Elisabeth Moss’ ‘Handmaid’s Tale’ Emmy chances, by the numbers – Yahoo

    ‘Gangs of London’ Producer Explains Season 3 Deaths, Hypes Season 4 – Citizen Tribune

    Gangs of London’ Producer Reveals Shocking Season 3 Deaths and Teases Exciting Season 4

    The Iconic Missouri Diner That Gives You A Taste Of Live Entertainment With Your Meal – Yahoo

    Savor Delicious Meals While Enjoying Live Entertainment at Missouri’s Iconic Diner

    Keke Palmer Revealed How She Came Up With Her Son Leodis’ Name – Yahoo

    Keke Palmer Shares the Heartwarming Story Behind Her Son Leodis’ Name

    The Media and Entertainment Deal Machine Is Revving Up – WSJ

    The Media and Entertainment Deal Machine Is Gearing Up for Action

    Op-Ed: Data Storage and Protection in Today’s Media & Entertainment Industry – Sports Video Group

    How Data Storage and Protection Are Transforming the Media & Entertainment Industry

  • General
  • Health
  • News

    Cracking the Code: Why China’s Economic Challenges Aren’t Shaking Markets, Unlike America’s” – Bloomberg

    Trump’s Narrow Window to Spread the Truth About Harris

    Trump’s Narrow Window to Spread the Truth About Harris

    Israel-Gaza war live updates: Hamas leader Ismail Haniyeh assassinated in Iran, group says

    Israel-Gaza war live updates: Hamas leader Ismail Haniyeh assassinated in Iran, group says

    PAP Boss to Niger Delta Youths, Stay Away from the Protest

    PAP Boss to Niger Delta Youths, Stay Away from the Protest

    Court Restricts Protests In Lagos To Freedom, Peace Park

    Court Restricts Protests In Lagos To Freedom, Peace Park

    Fans React to Jazz Jennings’ Inspiring Weight Loss Journey

    Fans React to Jazz Jennings’ Inspiring Weight Loss Journey

    Trending Tags

    • Trump Inauguration
    • United Stated
    • White House
    • Market Stories
    • Election Results
  • Science
  • Sports
  • Technology
    Further Upside For Aeries Technology, Inc (NASDAQ:AERT) Shares Could Introduce Price Risks After 27% Bounce – simplywall.st

    Further Upside For Aeries Technology, Inc (NASDAQ:AERT) Shares Could Introduce Price Risks After 27% Bounce – simplywall.st

    Editor’s Pick: 9 Books on Technology – The Gospel Coalition

    9 Must-Read Books That Will Completely Transform How You Understand Technology

    New Semiconductor Technology Could Supercharge 6G Delivery – SciTechDaily

    Revolutionary Semiconductor Technology Set to Turbocharge 6G Connectivity

    UTC To Host Quantum Technology Workshop June 23-25 – Chattanoogan.com: Breaking News

    Join the Quantum Technology Workshop This June 23-25!

    Rimac Technology Powers the Bugatti Tourbillon with Cutting-Edge Battery and Powertrain Tech – Rimac Newsroom

    Rimac Technology Drives the Bugatti Tourbillon with Revolutionary Battery and Powertrain Innovation

    “Co-creation” boosts commercial technology for dual-use defense applications – Breaking Defense

    “Co-creation” boosts commercial technology for dual-use defense applications – Breaking Defense

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
No Result
View All Result
Earth-News
No Result
View All Result
Home Technology

Show HN: Restate – low-latency durable workflows for JavaScript/Java, in Rust

June 12, 2024
in Technology
Show HN: Restate – low-latency durable workflows for JavaScript/Java, in Rust
Share on FacebookShare on Twitter

Announcing Restate 1.0, Restate Cloud, and our Seed Funding Round   Read more

As regular functions and services, in your existing infrastructure. On FaaS, K8s, servers, containers. Self-hosted or fully managed. Restate meets you where you are.

Easy solutions for common challenges

Workflows as code

Workflows as code

Durable Execution ensures code runs reliably to the end, even in the presence of failures.

‍

Failures and errors are automatically retried (unless labeled as terminal errors)Functions can memoize the results of code blocks, and actions like RPC, in a journal. Completed steps are not re-executed during retries, but replayed from the journal.Workflows are built with regular code and control flow, no custom DSLs needed.Durable sleeps let code wait and suspend for up to months

‍

> Learn More

export default restate.service({
name: “roleUpdate”,
handlers: {
applyRoleUpdate: async (ctx, update)=> {
const { userId, role, permissions }=update;
const applied=await ctx.run(“apply new role”, ()=>
applyUserRole(userId, role)
);
if (!applied) {
return;
}
for (const permission of permissions) {
await ctx.run(“apply permission”, ()=>
applyPermission(userId, permission)
);
}
}
}
});

@Service
public class RoleUpdateService {

@Handler
public void applyRoleUpdate(Context ctx, Update update) {

boolean success=ctx.run(“apply new role”, BOOLEAN,
() -> applyUserRole(update.getUserId(), update.getRole()));

if (!success) {
return;
}

for (String permission : update.getPermissions()) {
ctx.run(“apply permission”,
() -> applyPermission(update.getUserId(), permission));
}
}
}

API calls and webhooks

API calls and webhooks

Reliably join synchronous code and async events like webhooks

Webhooks/events are persisted in Restate’s log and reliably delivered to servicesPersistent Promises/Futures easily join synchronous and asynchronous code pathsDurable execution ensures reliable completion, whether webhooks come after milliseconds or months, and avoid re-execution of completed steps.

> Learn More

const paymentSvc=restate.service({
name: “payments”,
handlers: {
processPayment: async (ctx, request)=> {
const webhookPromise=ctx.awakeable();
const paymentIntent=await ctx.run(“stripe call”, ()=>
createPaymentIntent({
request,
metadata: { restate_callback_id: webhookPromise.id }
})
);
if (paymentIntent.status===”processing”) {
// synchronous response inconclusive, await webhook response
const paymentIntentFromWebhook=await webhookPromise.promise;
return verifyPayment(paymentIntentFromWebhook);
} else {
return verifyPayment(paymentIntent);
}
},
processWebhook: async (ctx)=> {
const paymentIntent=verifyAndParseEvent(ctx.request());
const webhookPromiseId=paymentIntent.metadata.restate_callback_id;
ctx.resolveAwakeable(webhookPromiseId, paymentIntent);
}
}
});

@Service
public class PaymentService {
@Handler
public void processPayment(Context ctx, PaymentRequest request) {
var webhookFuture=ctx.awakeable(SERDE);
var payment=ctx.run(“Stripe call”, SERDE, () -> submitPayment(
request, Map.of(“restate_callback_id”, webhookFuture.id())
));
if (payment.getStatus().equals(“processing”)) {
// synchronous response inconclusive, await webhook response
var updatedPayment=webhookFuture.await();
verifyPayment(updatedPayment);
} else {
verifyPayment(payment);
}
}
@Handler
public void processWebhook(Context ctx) {
var paymentEvent=verifyAndParseEvent(ctx.request());
String callbackId=paymentEvent.getMetadata().get(“restate_callback_id”);
ctx.awakeableHandle(callbackId).resolve(SERDE, paymentEvent);
}
}

Asynchronous Tasks

Asynchronous Tasks

All functions invoked through Restate are executed durably and asynchronous.

Deploy async functions serverless or as containers or processes.Call functions synchronously, async, or delayed. Re-attach and await from anywhere.Build async patterns like fan-out, fan-in, task chains, and subtasks simply with function calls and Futures/Promises.Use persistent timers to schedule tasks into the future.Use fine-grained virtual queues (via virtual objects) to enforce strict task order and concurrency

> Learn More

// —— service (=worker) ——
const asyncTaskService=restate.service({
name: “taskWorker”,
handlers: { processPayment }
});
// —— client ——
const rs=clients.connect({ url: process.env.RESTATE_URL });
const taskWorker=rs.serviceSendClient({ name: “taskWorker” });
// submit the payment task
app.post(‘/charge/:paymentId’, async (req, res)=> {
const taskHandle=await taskWorker.processPayment(
{ request: req.params },
SendOpts.from({ idempotencyKey: req.params.paymentId })
);
res.json(taskHandle);
});
// await the payment task
app.get(‘/status’, async (req,res)=> {
const taskHandle=req.body.json();
const paymentResult=await restate.result(taskHandle);
res.join(paymentResult);
});

// — start payment task —
server.createContext(“/charge”, httpExchange -> {
PaymentRequest req=parsePaymentRequest(httpExchange);
SendResponse handle=AsyncTaskServiceClient
.fromIngress(RESTATE_URI)
.send()
.processPayment(req, idempotencyKey(req.getPaymentId()));

respondJson(httpExchange, handle);
});
// — connect to payment result —
server.createContext(“/status”, httpExchange -> {
String handle=parseToHandle(httpExchange);
String response=IngressClient.defaultClient(RESTATE_URI)
.invocationHandle(handle, STRING)
.attach();
respond(httpExchange, response);
});

Stateful Event Processing

Stateful Event Processing

Process events (for example from Kafka) with durable functions as event handlers and get fine-grained retries and workflow-as-code semantics.

No queue subscriptions, no manual offset management, scaling, or balancingDeploy the event processing logic as serverless functions on FaaSKeep exactly-once state, delay events, run multiple asynchronous steps or API calls.Restate’s queue-per-key semantics mean no more head-of-the-line waiting effects

> Learn More

const eventEnricher=restate.object({
name: “eventEnricher”,
handlers: {
userEvent: async (ctx, event)=> {
// remember event, time box 100 ms to collect features
// before emitting result
ctx.set(“user”, event);
ctx.serviceSendClient(eventEnricher, { delay: 100 }).emit();
},
featureEvent: async (ctx, featureEvent)=> {
// merge feature into event
const userEvent=(await ctx.get(“user”)) ?? {};
(userEvent.features ??=[]).push(featureEvent);
ctx.set(“user”, userEvent)
},
emit: async (ctx)=> {
emit(ctx.key, await ctx.get(“user”));
ctx.clearAll();
}
}
})

@VirtualObject
public class EventEnricher {
static final StateKey USER=StateKey.of(“user”, of(User.class));
@Handler
public void userEvent(ObjectContext ctx, User event) {
ctx.set(USER, event);
// time box 100 ms to collect features before emitting result
EventEnricherClient.fromContext(ctx, ctx.key())
.send(ofMillis(100)).emit();
}
@Handler
public void featureEvent(ObjectContext ctx, Feature event) {
User user=ctx.get(USER).orElse(new User());
user.addFeature(event);
ctx.set(USER, user);
}
@Handler
public void emit(ObjectContext ctx) {
send(ctx.key(), ctx.get(USER));
ctx.clearAll();
}
}

Durable Signals

Durable Signals

Create workflows and event handlers that reliably handle external signals, events, human input.

‍

Use durable Promises/Futures to intuitively model signals and conditionsCreate signals from RPCs, webhooks, or Kafka eventsSignals and events are persisted by Restate, no need for a queue

> Learn More

export default workflow({
name: “verify”,
handlers: {
run: async (ctx, { email })=> {
const secret=ctx.run(“generate secret”, ()=>
crypto.randomUUID()
);
await ctx.run(“send email”, ()=> sendEmail({ email, secret }));

const clickSecret=await ctx.promise(“email.clicked”);
return clickSecret==secret;
},
click: (ctx, { secret })=> {
ctx.promise(“email.clicked”).resolve(secret);
},
},
});

@Workflow
public class SecretVerifier {

static final DurablePromiseKey EMAIL_CLICKED=
DurablePromiseKey.of(“email_clicked”, JsonSerdes.STRING);

@Workflow
public boolean run(WorkflowContext ctx, Email email) {
String secret=ctx.random().nextUUID().toString();
ctx.run(“send email”,
() -> sendEmailWithLink(email, secret));

String clickSecret=ctx.promise(EMAIL_CLICKED).awaitable().await();
return clickSecret.equals(secret);
}

@Handler
public void click(SharedWorkflowContext ctx, String secret) {
ctx.promiseHandle(EMAIL_CLICKED).resolve(secret);
}
}

Idempotency

Idempotency

Add idempotency to any RPC- or event handler.

‍

Every RPC- and event handler call accepts an idempotency keyUse idempotency keys to re-attach to an ongoing invocationCalls from within a durable execution context are automatically idempotent

> Learn More

const rs=restate.connect({ url: process.env.RESTATE_URL });
app.get(‘/reserve/:product/:reservationId’, async (req, res)=> {
const { product, reservationId }=req.params;
const products=rs.serviceClient(ProductService);
const reservation=await products.reserve(
product,
Opts.from({ idempotencyKey : reservationId })
);
res.json(reservation);
})

server.createContext(“/reserve”, httpExchange -> {
ReservationRequest req=parseRequest(httpExchange.getRequestBody());
// derive an idempotency key from the parameters
var idempotencyOps=CallRequestOptions.DEFAULT
.withIdempotency(req.getReservationId());
// add idempotency opts to the request to let the service automatically
// fuse repeated requests
Reservation reservation=ProductServiceClient
.fromIngress(RESTATE_RUNTIME_ENDPOINT)
.reserve(req.getProduct(), idempotencyOps);
sendResponse(httpExchange, reservation);
});

Sagas

Sagas

Implements robust sagas and compensation patterns: long-running transactions that undo previous actions when they need to abort and roll back.

‍

Reliably pick up after failures to trigger compensationsEnsure compensations happen even upon failures during the compensation phaseUse standard Exception/Error mechanisms and control flow rather than complex DSLs.

> Learn More

async function reservation(ctx, products) {
const reservations=[];
try {
for (const product of products) {
const reservation=await ctx.run(`reserve ${product}`,
()=> reserve(product));
reservations.push(reservation);
}
} catch (error) {
if (error instanceof TerminalError) {
for (const reservation of reservations) {
await ctx.run(“undo reserve”, ()=>
cancelReservation(reservation));
}
}
throw error;
}
}

@Handler
public void reserveAllProducts(Context ctx, Product[] products) {
final List reservations=new ArrayList();
try {
for (Product product : products) {
Reservation res=ctx.run(“Reserve ” + product.getId(),
RESERVE_SERDE, () -> reserve(product)
);
reservations.add(res);
}
} catch (TerminalException e) {
reservations.forEach(res -> {
ctx.run(“Undo reservation”, () -> cancelReservation(res));
});
throw e;
}
}

State machines

State machines

Create consistent and scalable State Machines without databases or transactions
‍

Run millions of State Machines that maintain state directly in the context of their handlersState changes commit atomically with function execution, for rock-solid consistencySingle-writer semantics for a dead simple concurrency model. A virtual queue per state machine for efficiency and scalability.State transition can be workflows with all the features from durable execution

> Learn More

const paymentSvc=restate.object({
name: “payments”,
handlers: {
makePayment: async (ctx, payment)=> {
const paymentId=ctx.key;
switch (await ctx.get(“status”)) {
case “CANCELLED”:
return `${paymentId} was cancelled before`;
case “SUCCESS”:
return `${paymentId} previously completed`;
}
wireFunds(payment);
ctx.set(“status”, “SUCCESS”);
ctx.set(“payment”, payment);
},
cancelPayment: async (ctx)=> {
const status=await ctx.get(“status”);
if (status===”SUCCESS”) {
const payment=await ctx.get(“payment”);
refund(payment);
}
ctx.set(“status”, “CANCELLED”);
}
}
});

@VirtualObject
public class PaymentStateMachine {
@Handler
public String makePayment(ObjectContext ctx, PaymentRequest payment) {
String paymentId=ctx.key();
switch (ctx.get(STATE_STATUS).orElse(NEW)) {
case CANCELLED: return paymentId + ” was cancelled before”;
case SUCCESS: return paymentId + ” was previously completed”;
}
wireFunds(payment);
ctx.set(STATE_STATUS, SUCCESS);
ctx.set(STATE_PAYMENT_REQUEST, payment);
return paymentId + ” was successfully processed”;
}
@Handler
public void cancelPayment(ObjectContext ctx) {
Status status=ctx.get(STATE_STATUS).orElse(NEW);
if (status==SUCCESS) {
PaymentRequest payment=ctx.get(STATE_PAYMENT_REQUEST).get();
refund(payment);
}
ctx.set(STATE_STATUS, CANCELLED);
}
}

A simple and powerful programming model

Restate provides distributed durable version of your everyday building blocks.

> See how it works

Durable Execution

Functions/Services that handle retries, recovery, asynchrony, idempotency.

Virtual Objects

Persistent state directly in your objects with a simple concurrency model.

Durable Promises

Transparent and fault-tolerant communication across services, processes, and time.

Single binary, no dependencies, built in Rust.

A system that runs locally and on-prem just as well as in the 
cloud. Restate server comes as a single binary. Simple to run, 
simple to operate.

Fully self-contained, resource-efficient, resilient, thanks to 
Rust’s magic.

Stellar local dev-experience

What’s better than a local dev server?

Running the real system on your laptop or in your CI pipeline. No subtle quirks and differences between dev- and prod setups.

Your Restate-powered code is just functions/services. Develop them with the tools you know and love.

Restate Cloud: The zero-infrastructure option

Get a fully serverless Restate experience, managed by the developers of the system.

Sign in, generate keys, point your app, go!

> Get Access

Copyright © 2024 Restate. All rights reserved.

>>> Read full article>>>
Copyright for syndicated content belongs to the linked Source : Hacker News – https://restate.dev/

Tags: low-latencyRestatetechnology
Previous Post

UEM Sunrise Selling Malaysia Data Centre Plots for $30M, Deal Linked to Singtel

Next Post

Launch HN: Overwatch (YC S22): OSINT platform for cyber and fraud risk

NCSE welcomes Britt Miller – National Center for Science Education

NCSE welcomes Britt Miller – National Center for Science Education

June 16, 2025
Science is on the federal chopping block and North Carolinians will suffer – NC Newsline

Federal Science Funding Slashed: How North Carolinians Will Be Impacted

June 16, 2025
Does yard work count as exercise? UI expert provides tips to maintain a healthy lifestyle during busy summer months – Iowa Now

Is Yard Work Really Exercise? Expert Tips for Staying Healthy During Busy Summer Months

June 16, 2025
Insurers must promote the blue economy – Eco-Business

Insurers must promote the blue economy – Eco-Business

June 16, 2025
Elisabeth Moss’ ‘Handmaid’s Tale’ Emmy chances, by the numbers – Yahoo

Elisabeth Moss’ ‘Handmaid’s Tale’ Emmy chances, by the numbers – Yahoo

June 16, 2025
Tariffs Are Driving 2026 Health Insurance Premiums Up – KFF

Tariffs Are Driving 2026 Health Insurance Premiums Up – KFF

June 16, 2025
Minnesota, Known for Bipartisan Civility, Reels After Attack on Lawmakers – The New York Times

Minnesota, Known for Bipartisan Civility, Reels After Attack on Lawmakers – The New York Times

June 16, 2025
FDA Grants Sarepta Therapeutics Platform Technology Designation to Expedite Gene Therapy Reviews – geneonline.com

FDA Accelerates Gene Therapy Reviews with Breakthrough Platform Technology for Sarepta Therapeutics

June 16, 2025
Grading Auburn sports in 2024-25: How we saw football stack up in latest athletic calendar – Montgomery Advertiser

Auburn Sports 2024-25: Breaking Down the Football Season’s Biggest Highlights

June 16, 2025
Brain development in a facultatively social allodapine bee aligns with caste, but not group living – Frontiers

Brain development in a facultatively social allodapine bee aligns with caste, but not group living – Frontiers

June 16, 2025

Categories

Archives

June 2025
MTWTFSS
 1
2345678
9101112131415
16171819202122
23242526272829
30 
« May    
Earth-News.info

The Earth News is an independent English-language daily published Website from all around the World News

Browse by Category

  • Business (20,132)
  • Ecology (688)
  • Economy (703)
  • Entertainment (21,606)
  • General (15,411)
  • Health (9,744)
  • Lifestyle (708)
  • News (22,149)
  • People (705)
  • Politics (710)
  • Science (15,921)
  • Sports (21,202)
  • Technology (15,690)
  • World (683)

Recent News

NCSE welcomes Britt Miller – National Center for Science Education

NCSE welcomes Britt Miller – National Center for Science Education

June 16, 2025
Science is on the federal chopping block and North Carolinians will suffer – NC Newsline

Federal Science Funding Slashed: How North Carolinians Will Be Impacted

June 16, 2025
  • About
  • Advertise
  • Privacy & Policy
  • Contact

© 2023 earth-news.info

No Result
View All Result

© 2023 earth-news.info

No Result
View All Result

© 2023 earth-news.info

Go to mobile version