osmaczko 7838d43b30
feat(client): add threaded transport polling (#125)
The client, not the app, now drives the transport; events are delivered
asynchronously, per ADR 0001.

- ChatClient owns Arc<Mutex<Core>> + a worker thread.
- The worker select!s over the inbound and shutdown channels; Drop joins it.
  Outbound runs on the caller's thread.
- A single Transport (DeliveryService + inbound()) owns both directions of the
  boundary, so the client takes one transport rather than a (delivery, inbound)
  pair. InProcessDelivery::new, CDelivery, and chat-cli's transports implement it.
- FFI replaces client_receive with client_push_inbound + client_poll_events.
- chat-cli drains Receiver<Event>; inbound and event channels are both crossbeam.
- Corrects ADR 0001's inbound sequence to push — the worker parks on select!,
  it never polls.
2026-06-11 10:08:07 +02:00
..

message-exchange

An example C application built on top of crates/client-ffi.

It demonstrates that the C ABI exposed by crates/client-ffi is straightforward to consume from plain C — or from any language that can call into a C ABI. No Rust code, no Cargo project: just a C source file linked against the pre-built static library.

Building and running

make        # builds client-ffi with Cargo, then compiles src/main.c
make run    # build + execute
make clean  # remove the compiled binary

For a release build:

make CARGO_PROFILE=release