Returns the promise that is resolved when a connection becomes available. Usually, you don't have to call this method manually, since the connection would be established automatically as soon as the first request is sent or the first listener is subscribed.
Returns the established connection, or null
if it isn't available. Use connect to establish a connection.
Sends an event through a connection to Android and returns a response event.
The connection is automatically established when this method is called.
The error is thrown if org.racehorse.ExceptionEvent
is published as a response, if the response event wasn't
published synchronously, or if connection cannot be established synchronously.
The request event to send.
The response event.
Sends an event through a connection to Android and returns a promise that is resolved with a response event.
The connection is automatically established when this method is called.
The returned promise is rejected if org.racehorse.ExceptionEvent
is published as a response.
The request event to send.
The response event.
Subscribes a listener to all notice events pushed by Android.
The connection is automatically established when this method is called.
The callback that unsubscribes the listener.
Subscribes a listener to notice events of the particular type pushed by Android.
The connection is automatically established when this method is called.
The type of the event to subscribe to.
The listener to subscribe.
The callback that unsubscribes the listener.
The event bridge that transports events between Android and web.