class PollingChannel
package feathers.messaging.channels
extends Channel
extended by NetConnectionChannel
The PollingChannel class provides the polling behavior that all polling channels in the messaging system require.
Constructor
new(?id:String, ?uri:String)
Creates a new PollingChannel instance with the specified id. Once a PollingChannel is connected and begins polling, it will issue a poll request once every three seconds by default.
Note: The PollingChannel type should not be constructed directly. Instead create instances of protocol specific subclasses such as HTTPChannel or AMFChannel that extend it.
Parameters:
id | The id of this Channel. |
---|---|
uri | The uri for this Channel. |
Methods
disablePolling():Void
Disables polling based on the number of times enablePolling()
and disablePolling()
have been invoked. If the net result is to disable
polling the channel stops polling.
Invoked automatically based upon subscribing or unsubscribing from a remote destination over a PollingChannel.
enablePolling():Void
Enables polling based on the number of times enablePolling()
and disablePolling()
have been invoked. If the net result is to enable
polling the channel will poll the server on behalf of connected MessageAgents.
Invoked automatically based upon subscribing or unsubscribing from a remote destination over a PollingChannel.
poll():Void
Initiates a poll operation if there are consumers subscribed to this channel, and polling is enabled for this channel.
Note that this method will not start a new poll if one is currently in progress.
send(agent:MessageAgent, message:IMessage):Void
Sends the specified message to its target destination.
Subclasses must override the internalSend()
method to
perform the actual send.
PollingChannel
will wrap outbound messages in poll requests if a poll
is not currently outstanding.
Parameters:
agent | The MessageAgent that is sending the message. |
---|---|
message | The Message to send. |
Throws:
mx.messaging.errors.InvalidDestinationError | If neither the MessageAgent nor the message specify a destination. |
---|