Skip to content

feat(hydro_lang): add sim_atomic_input API#2851

Open
shadaj wants to merge 1 commit intomainfrom
sandbox-15952e72-fc63-4b8e-a9d1-7b7bd73be15c
Open

feat(hydro_lang): add sim_atomic_input API#2851
shadaj wants to merge 1 commit intomainfrom
sandbox-15952e72-fc63-4b8e-a9d1-7b7bd73be15c

Conversation

@shadaj
Copy link
Copy Markdown
Member

@shadaj shadaj commented May 6, 2026

Summary

Adds Process::sim_atomic_input() which returns a SimAtomicSender<T> and an atomic stream. The sender's async send method resolves once the atomic tick has completed processing.

Implementation

Internally wraps values in Rc<RefCell<Option<T>>> to clone the stream without requiring T: Clone — one branch takes the value (returned to the user), the other maps to () and flows through end_atomic().sim_output() to signal completion.

Usage

let (sender, atomic_stream) = process.sim_atomic_input::<i32>();
// Use atomic_stream in your dataflow

// At runtime:
sender.send(42).await; // resolves after atomic tick completes

Closes #2772

@shadaj shadaj requested a review from a team May 6, 2026 21:59
@shadaj shadaj force-pushed the sandbox-15952e72-fc63-4b8e-a9d1-7b7bd73be15c branch from d30aa7d to 0826e9f Compare May 6, 2026 22:04
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 6, 2026

Deploying hydro with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7cf7636
Status: ✅  Deploy successful!
Preview URL: https://c0d88664.hydroflow.pages.dev
Branch Preview URL: https://sandbox-15952e72-fc63-4b8e-a.hydroflow.pages.dev

View logs

@shadaj shadaj force-pushed the sandbox-15952e72-fc63-4b8e-a9d1-7b7bd73be15c branch 2 times, most recently from a30a3e8 to c27737e Compare May 6, 2026 22:50
@shadaj shadaj force-pushed the sandbox-15952e72-fc63-4b8e-a9d1-7b7bd73be15c branch from c27737e to 7cf7636 Compare May 6, 2026 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Embedded mode: native atomic input with ack future

1 participant