UNPKG

@stomp/rx-stomp

Version:

RxJS STOMP client for Javascript and Typescript

52 lines 1.7 kB
/** * Connection lifecycle states for RxStomp. * * These states reflect the status of the underlying STOMP-over-WebSocket connection * as well as the client's activation/deactivation lifecycle. * * Common usage: * ```typescript * rxStomp.connectionState$.subscribe((state) => { * switch (state) { * case RxStompState.CONNECTING: * console.log('Attempting to connect...'); * break; * case RxStompState.OPEN: * console.log('Connected'); * break; * case RxStompState.CLOSING: * console.log('Disconnecting...'); * break; * case RxStompState.CLOSED: * console.log('Disconnected'); * break; * } * }); * ``` * * Part of `@stomp/rx-stomp` */ export var RxStompState; (function (RxStompState) { /** * A connection attempt is in progress. This includes the WebSocket opening * and the STOMP CONNECT handshake phase. */ RxStompState[RxStompState["CONNECTING"] = 0] = "CONNECTING"; /** * The STOMP session is fully established and operational. * Messages can be published, and subscriptions will receive messages. */ RxStompState[RxStompState["OPEN"] = 1] = "OPEN"; /** * A graceful shutdown has been requested and is underway. * New subscriptions/publishes should be avoided during this phase. */ RxStompState[RxStompState["CLOSING"] = 2] = "CLOSING"; /** * There is no active connection to the broker. * The client may be inactive or waiting to retry based on reconnection settings. */ RxStompState[RxStompState["CLOSED"] = 3] = "CLOSED"; })(RxStompState || (RxStompState = {})); //# sourceMappingURL=rx-stomp-state.js.map