Requires
maximem-synap 0.5.1 or newer (Python) and
@maximem/synap-js-sdk 0.5.1 or newer (JS). Earlier versions do not
have this method, and 0.5.0 loses events sent immediately after
listen().What an acknowledgement means
An acknowledgement says the platform has the event: recorded so a repeat is recognised, queued for anticipation, and for conversation turns handed to the writer that persists them.When the stream drops
Two things can be in flight when a connection goes:- Events you sent while there was no stream. They are buffered and sent when one comes back.
- Events that went out but were never acknowledged. The write succeeded and the stream broke before the platform confirmed it. These are replayed first, because they happened first.
Closing cleanly
stop_listening() flushes what is still buffered before the stream goes away, with a short deadline, and closes any session it opened. The buffer lives in memory, so anything still in it when your process exits is gone. If your process can exit abruptly, call stop_listening() on your shutdown path.
Clients that cannot hold a stream
The gRPC stream needs a connection held open for the length of a conversation. A serverless function, a short-lived worker, or anything that suspends between requests cannot do that. Those clients send the same events over HTTP instead:event_id and the route is idempotent: retrying a batch that half-succeeded cannot double a turn.
See also
- instance.listen: opening the stream.
- instance.send_message: the event table.
- Real-time anticipation: what the platform does with the events.