Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WampBinding

Defines a communication binding for transmitting Coaty communication events via the WAMP publish-subscribe messaging protocol.

This binding is compatible with any WAMP router that supports the WAMP v2 protocol.

This binding provides the following WAMP specific publication options for Raw events:

  • retain: false | true (defaults to false)
  • acknowledge: false | true (defaults to false)

This binding provides the following WAMP specific subscription options for Raw events:

  • match: "exact" | "prefix" | "wildcard" (defaults to "exact")
remarks

To enable debug mode of the underlying autobahn library, set global variable AUTOBAHN_DEBUG to true before loading this binding. Likewise, to enable output of warnings of the underlying autobahn library, set global variable AUTOBAHN_WARN to true.

Hierarchy

Implements

  • CommunicationBindingProtocol

Index

Constructors

constructor

  • internal

    For internal use in framework only.

    Create an instance of this binding type with the given options.

    Parameters

    Returns WampBinding

Properties

Static Protected Readonly DEFAULT_NAMESPACE

DEFAULT_NAMESPACE: "-" = "-"

Accessors

apiName

  • get apiName(): string

apiVersion

  • get apiVersion(): number

options

  • Gets the binding options (read-only).

    remarks

    For the optional base binding options defined in CommunicationBindingOptions, (default) values are always set by the base binding class. Thus, a concrete binding class need not check whether a value is defined for these properties.

    Returns Readonly<WampBindingOptions>

state

  • get state(): CommunicationBindingState
  • Returns CommunicationBindingState

Methods

addListener

  • addListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

createIoRoute

  • createIoRoute(ioSourceId: string): string
  • Parameters

    • ioSourceId: string

    Returns string

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): Array<string | symbol>
  • Returns Array<string | symbol>

getMaxListeners

  • getMaxListeners(): number

join

  • join(joinOptions: CommunicationBindingJoinOptions): void
  • Parameters

    • joinOptions: CommunicationBindingJoinOptions

    Returns void

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

Protected log

  • log(logLevel: CommunicationBindingLogLevel, arg1: string, arg2?: any, arg3?: any, arg4?: any): void
  • Parameters

    • logLevel: CommunicationBindingLogLevel
    • arg1: string
    • Optional arg2: any
    • Optional arg3: any
    • Optional arg4: any

    Returns void

off

  • off(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

on

  • on(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

Protected onInit

  • onInit(): void

Protected onJoin

  • onJoin(joinOptions: CommunicationBindingJoinOptions): void
  • Parameters

    • joinOptions: CommunicationBindingJoinOptions

    Returns void

Protected onPublish

  • onPublish(eventLike: CommunicationEventLike): void
  • Parameters

    • eventLike: CommunicationEventLike

    Returns void

Protected onSubscribe

  • onSubscribe(eventLike: CommunicationEventLike): void
  • Parameters

    • eventLike: CommunicationEventLike

    Returns void

Protected onUnjoin

  • onUnjoin(): Promise<void>

Protected onUnsubscribe

  • onUnsubscribe(eventLike: CommunicationEventLike): void
  • Parameters

    • eventLike: CommunicationEventLike

    Returns void

once

  • once(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependListener

  • prependListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

publish

  • publish(eventLike: CommunicationEventLike): void
  • Parameters

    • eventLike: CommunicationEventLike

    Returns void

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeListener

  • removeListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

setMaxListeners

  • setMaxListeners(n: number): this

subscribe

  • subscribe(eventLike: CommunicationEventLike): void
  • Parameters

    • eventLike: CommunicationEventLike

    Returns void

unjoin

  • unjoin(): Promise<void>
  • Returns Promise<void>

unsubscribe

  • unsubscribe(eventLike: CommunicationEventLike): void
  • Parameters

    • eventLike: CommunicationEventLike

    Returns void

Static withOptions

  • Provides the WAMP binding with application-specific options as value of the CommunicationOptions.binding property in the agent container configuration.

    To be used as follows:

    import { WampBinding } from "@coaty/binding.wamp";
    
    const configuration: Configuration = {
      ...
      communication: {
          binding: WampBinding.withOptions({
              routerUrl: ... ,
              ...
          }),
          ...
      },
      ...
    };

    Parameters

    Returns CommunicationBindingWithOptions<WampBinding, WampBindingOptions>

Generated using TypeDoc