CLASS
SSETransportDriver
Client-side HTTP(S) + SSE bidirectional transport
Used for communication with Spatium Signer Service. As soon as created, it immediately tries to connect to a provided url and start listening for incoming messages
- SeeAlso
TransportDriver
Properties
auth
Methods
init(url:auth:)
Note
requests are attributed to accountId of an authorization session, thus storing data independently for each authorized user
Parameters
Name | Description |
---|---|
url | signer service endpoint (HTTP(S)) |
auth | authorization AuthorizationSession session to use |
send(meta:data:)
Parameters
Name | Description |
---|---|
meta | message identifiers |
data | message data |
connect(timeout:)
Connect and start listening to events
disconnect()
Stop listening for messages and disconnect
on(filter:callback:)
Parameters
Name | Description |
---|---|
filter | incoming message filter |
callback | to be invoked with messages matching to a provided filter |
off(id:data:)
Parameters
Name | Description |
---|---|
id | subscription identifier returned upon creation |
data | (optional) message data to be sent to a current subscriber’s callback |