sends the specified message msg to the specified channel.

Details and Options

  • In ChannelSend[channel,], channel can be specified as a channel object or in any of the forms used inside ChannelObject.
  • The message will typically be an association of the form <|"param1"->val1,|>, but can be any expression.
  • ChannelSend[channel,msg] preprocesses msg by applying to it the function specified as the setting for ChannelPreSendFunction for channel.
  • With the default setting $AllowExternalChannelFunctions=False, ChannelSend[channel,] works only for certified channels and for channels owned by you.
  • ChannelPreSendFunction->f overrides the default pre-send handler for the channel.
  • Specifying the ChannelPreSendFunction option in ChannelSend[channel,msg,ChannelPreSendFunction->f] lets you send a message on the channel without enabling $AllowExternalChannelFunctions globally.
  • The effect of ChannelSend[channel,assoc] can be achieved with an HTTP request to the channel URL with operation=send in the query string and the serialized association assoc in the body (for a POST request) or the query string (for a GET request).


open all close all

Basic Examples  (1)

Start listening on a channel and send a message on the channel:

Click for copyable input

Send a message on the channel:

Click for copyable input

The message is available from the listener, in the form specified for the ChannelListener object:

Click for copyable input

Scope  (5)

Applications  (1)

Properties & Relations  (3)

Possible Issues  (1)

Introduced in 2016