ChannelListener
represents a channel listener created by ChannelListen.
Details
- ChannelListener[…]["prop"] gives the property prop of a channel listener.
- ChannelListener[…]["prop",n] gives a list of properties for the n most recently received messages.
- ChannelListener[…]["prop",All] gives a list of properties for all messages stored.
- ChannelListener[…][{"prop1","prop2",…},…] gives a list of results for the propi.
- Possible properties related to individual messages include:
-
"Message" contents of the message "MetaInformation" metainformation accompanying the message "FullMessage" message and metainformation "MessageID" ID for the message "Timestamp" server timestamp for the message "RequesterWolframID" Wolfram ID of the sender "RequesterWolframUUID" Wolfram UUID of the sender - The contents of a message are given literally if the message is a string, Real, Integer, ByteArray, True, False, Null, Image or Image3D, or a list or association of such objects. All other messages are given either in the form HoldComplete[DisableFormatting[expr]] or as a list or association of delayed rules of the form "name"DisableFormatting[val].
- For security reasons, you should exercise caution in accessing unevaluated message contents, such as parts of held expressions, right-hand sides of delayed rules, or applying ToExpression to string messages.
- Possible properties related to sets of messages include:
-
"TimeSeries" association of time series of elements in messages "Dataset" dataset of elements in messages - Properties related to the channel listener and channel:
-
"ReceivedMessageCount" total number of messages received by the listener "AvailableMessageCount" number of messages currently stored by the listener (as limited by ChannelHistoryLength) "HandlerFunction" handler function applied to messages "Databin" databin (if any) associated with the channel "ChannelObject" the channel object being listened on "URL" the URL of the channel being listened on - Information of a ChannelListener may include the following properties:
-
"Status" status of the listener as a string "ChannelPath" path on the channel broker server of the channel being listened on "ChannelBase" base URL of channel broker server for the channel being listened on "ChannelObject" ChannelObject representing the channel being listened on "ChannelOwner" Wolfram ID of the user who owns the channel being listened on "ChannelProtocol" communication protocol used to connect to the channel being listened on "ReceivedMessageCount" total number of messages received by the listener "AvailableMessageCount" number of messages currently stored by the listener (as limited by ChannelHistoryLength)
Examples
open allclose allBasic Examples (1)
Create a ChannelListener object by starting to listen on a channel:
Send a message to the channel and retrieve it from the listener object:
Scope (8)
Last Message (1)
Recent Messages (3)
The number of received messages and their content:
Delete the channel, which removes the listener:
Time series of a number of messages sent in the form of an association, with a delay between messages:
A Dataset of received messages:
TimeSeries of raw data sent without a named key:
Atomic Messages (1)
Symbolic Messages (2)
Symbolic messages with immediately executable Wolfram Language code are kept unevaluated:
Formatting of unevaluated messages is also disabled:
Evaluate the message after examining its content:
Delayed rules in a message are given verbatim, as long as the left-hand side is a string, a number or one of a small set of atomic expressions like the symbols True, False or Null:
However, the formatting of right-hand sides of delayed rules is still disabled:
Evaluating the right-hand sides restores the normal formatting:
Listener & Channel Properties (1)
The URL representing the channel on which the listener is listening:
The ChannelObject representing the channel on which the listener is listening:
Properties & Relations (1)
Unevaluated parts of messages cached in ChannelListener are wrapped in DisableFormatting:
Text
Wolfram Research (2016), ChannelListener, Wolfram Language function, https://reference.wolfram.com/language/ref/ChannelListener.html.
CMS
Wolfram Language. 2016. "ChannelListener." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ChannelListener.html.
APA
Wolfram Language. (2016). ChannelListener. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ChannelListener.html