Strata is pre-1.0. APIs, protocol, and storage format may change.
strata_transport
strata_transport targets JavaScript. It wraps the browser WebSocket API.
Use strata_client to encode and decode the text that it sends.
Public API
Section titled “Public API”open_socket(url, on_open, on_message, on_close) -> Socketopens a browser WebSocket and registers callbacks.send_text(socket, text) -> Result(Nil, SendError)sends text when the socket is open and returnsError(SocketNotOpen)when it is not.close(socket) -> Nilstarts a normal close.websocket_url(host:, port:, path:, token:, secure:) -> Stringbuilds a Strata WebSocket URL and percent-encodes thetokenquery value once.random_replica_id() -> Stringmakes a local CRDT replica id.
CloseEvent is a JavaScript dynamic value. The transport can call the close
callback for both browser error and close events.
See Browser Transport for lifecycle and failure handling.
Source:
packages/strata_transport.