The ChannelEvent is used to propagate channel events within the messaging system.

Static variables

@:value("channelConnect")staticfinalread onlyCONNECT:String = "channelConnect"

The CONNECT event type; indicates that the Channel connected to its endpoint.

The value of this constant is "channelConnect".

The properties of the event object have the following values:

PropertyValue
`bubbles`false
`cancelable`false
`channel`The channel that generated this event.
`currentTarget`The Object that defines the event listener that handles the event. For example, if you use `myButton.addEventListener()` to register an event listener, myButton is the value of the `currentTarget`.
`target`The Object that dispatched the event; it is not always the Object listening for the event. Use the `currentTarget` property to always access the Object listening for the event.
`reconnecting` Indicates whether the channel that generated this event is reconnecting.
`rejected` Indicates whether the channel that generated this event was rejected. This would be true in the event that the channel has been disconnected due to inactivity and should not attempt to failover or connect on an alternate channel.

@:value("channelDisconnect")staticfinalread onlyDISCONNECT:String = "channelDisconnect"

The DISCONNECT event type; indicates that the Channel disconnected from its endpoint.

The value of this constant is "channelDisconnect".

The properties of the event object have the following values:

PropertyValue
`bubbles`false
`cancelable`false
`channel`The channel that generated this event.
`currentTarget`The Object that defines the event listener that handles the event. For example, if you use `myButton.addEventListener()` to register an event listener, myButton is the value of the `currentTarget`.
`target`The Object that dispatched the event; it is not always the Object listening for the event. Use the `currentTarget` property to always access the Object listening for the event.
`reconnecting` Indicates whether the channel that generated this event is reconnecting.
`rejected` Indicates whether the channel that generated this event was rejected. This would be true in the event that the channel has been disconnected due to inactivity and should not attempt to failover or connect on an alternate channel.

Static methods

@:value({ connected : false, rejected : false, reconnecting : false, channel : null })staticcreateEvent(type:String, ?channel:Channel, reconnecting:Bool = false, rejected:Bool = false, connected:Bool = false):ChannelEvent

Utility method to create a new ChannelEvent that doesn't bubble and is not cancelable.

Parameters:

type

The ChannelEvent type.

channel

The Channel generating the event.

reconnecting

Indicates whether the Channel is in the process of reconnecting or not.

rejected

Indicates whether the Channel's connection has been rejected, which suppresses automatic reconnection.

connected

Indicates whether the Channel that generated this event is already connected.

Returns:

New ChannelEvent.

Constructor

@:value({ connected : false, rejected : false, reconnecting : false, channel : null, cancelable : false, bubbles : false })new(type:String, bubbles:Bool = false, cancelable:Bool = false, ?channel:Channel, reconnecting:Bool = false, rejected:Bool = false, connected:Bool = false)

Constructs an instance of this event with the specified type and Channel instance.

Parameters:

type

The ChannelEvent type.

bubbles

Specifies whether the event can bubble up the display list hierarchy.

cancelable

Indicates whether the behavior associated with the event can be prevented; used by the RPC subclasses.

channel

The Channel generating the event.

reconnecting

Indicates whether the Channel is in the process of reconnecting or not.

rejected

Indicates whether the Channel's connection has been rejected, which suppresses automatic reconnection.

connected

Indicates whether the Channel that generated this event is already connected.

Variables

channel:Channel

The Channel that generated this event.

connected:Bool

Indicates whether the Channel that generated this event is already connected.

reconnecting:Bool

Indicates whether the Channel that generated this event is reconnecting.

rejected:Bool

Indicates whether the Channel that generated this event was rejected. This would be true in the event that the channel has been disconnected due to inactivity and should not attempt to failover or connect on an alternate channel.

Methods

clone():Event

Clones the ChannelEvent.

Returns:

Copy of this ChannelEvent.

toString():String

Returns a string representation of the ChannelEvent.

Returns:

String representation of the ChannelEvent.