Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • EventBus

Index

Constructors

constructor

  • Creates an instance of Rxified EventBus. This is useful if you want to wrap an existing non-Rxified EventBus instance. Otherwise, use the static factory method to create an instance.

    memberof

    EventBus

    Parameters

    • delegate: any

      non-Rxified EventBus instance

    Returns EventBus

Properties

delegate

delegate: any

Wrapped non-Rxified EventBus instance.

type

{*}

memberof

EventBus

state$

state$: Observable<State>

Observable stream of the state.

  • emits current state immediately upon subscription.
  • completes when state is CLOSED.
type

{Observable}

memberof

EventBus

Accessors

closeEvent

closeEvent:

Close event emitted by the underlying SockJS connection.

readonly
type

{(CloseEvent | null)}

memberof

EventBus

defaultHeaders

defaultHeaders:

Default EventBus message headers.

type

{*}

memberof

EventBus

state

state:

Current state

readonly
type

{State}

memberof

EventBus

Methods

close

  • close(): void
  • Close the EventBus and underlying SockJS connection.

    memberof

    EventBus

    Returns void

publish

  • publish(address: string, message: any, headers?: any): void
  • Publish a message.

    memberof

    EventBus

    Parameters

    • address: string
    • message: any
    • Optional headers: any

    Returns void

rxConsumer

  • rxConsumer(address: string, headers?: any): Observable<Message<any>>
  • Registers a message consumer on the EventBus. Returned observable:

    • waits until subscription to register the consumer.
    • unregisters consumer when unsubscribed.
    • emits received messages.
    • completes on EventBus close.
    memberof

    EventBus

    Parameters

    • address: string
    • Optional headers: any

    Returns Observable<Message<any>>

rxSend

  • rxSend(address: string, message: any, headers?: any): Observable<Message<any>>
  • Send a message and expect a reply. Returned observable:

    • waits until subscription to send the message.
    • emits the received reply message.
    • errors when receives an error reply.
    • completes after emitting the reply, or on EventBus close.
    memberof

    EventBus

    Parameters

    • address: string
    • message: any
    • Optional headers: any

    Returns Observable<Message<any>>

send

  • send(address: string, message: any, headers?: any): void
  • Send a message without expecting a reply.

    memberof

    EventBus

    Parameters

    • address: string
    • message: any
    • Optional headers: any

    Returns void

setPingEnabled

  • setPingEnabled(enabled: boolean): void
  • Enable or disable EventBus pings.

    memberof

    EventBus

    Parameters

    • enabled: boolean

    Returns void

Static create

  • Factory method to create an Rxified EventBus instance.

    static
    memberof

    EventBus

    Parameters

    • url: string

      Server URL

    • Optional options: Options

    Returns EventBus

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc