Something went wrong. Try again.
🦀🚀 Abstract over `Send` and `!Send` traits crates.io/crates/future_form
Something went wrong. Try again.
5 folders · 2 files
README.md
Effects Counter #
An FFI example demonstrating future_form's sans-IO effect protocol.
A counter service requests capabilities from the host (timestamps,
logging) rather than performing I/O directly. Foreign hosts (Go, Java,
Python) inspect pending effects, fulfill them, and re-poll.
What this demonstrates #
- The sans-IO effect protocol (
EffectSlot+EffectHandle) - Host-fulfilled effects:
GetTimestampandLog - Per-future
Arc<EffectSlot>for independent effect channels - The same async state machine driven by Go, Java, and Python hosts
Structure #
counter_effects/
├── counter_effects/ Domain logic: EffectCounter with GetTimestamp + Log effects
├── effects_bridge/ C ABI + JNI bridge (effects counter)
├── go_host/ Go host with effect fulfillment
├── java_host/ Java host with effect fulfillment
├── python_host/ Python host with effect fulfillment
└── run_test.sh Build + run across all hosts
Running #
From the workspace root, using nix develop .#ffi for foreign toolchains:
./future_form_ffi/examples/counter_effects/run_test.sh
Prerequisites #
See counter_simple for the basic polling pattern without effects. For concurrent operations with multiple effect types, see the key_value_store example.