caolan / mutiny

Peer-to-peer web applications runtime
4 stars 1 forks source link

Awareness API #26

Open caolan opened 3 months ago

caolan commented 3 months ago

In addition to message channels (that try to ensure delivery) - there should be an API for more ephemeral data like away status or cursor positions. These only need to work for online peers and delivery does not need to be guaranteed.

(split from #22)

awareness(peer_id, app_instance_uuid, message)

Sends an ephemeral message to another online peer. No retries are attempted and it is not queued: the message either succeeds or fails on first attempt. Delivery order might not be guaranteed. Any received messages awaiting processing are dropped when mutiny-app is closed.

This can be used for ephemeral data like away/typing notifications, cursor positions, etc.