Processe quaisquer tipos de dados
As mensagens que podem ser representadas no formato JSON (cadeias de caracteres, números, True, False, ou Null), ou listas, regras, ou associações que possuem tais elementos, são dados literalmente.
In[1]:=

listener = ChannelListen["example"]
Out[1]=

In[2]:=

(ChannelSend["example", #]) & /@ {"string", 100, True, {1, 2, 3},
"a" -> "b", {"c" -> 1}, <|"d" -> True|>};
In[3]:=

listener["Message", All]
Out[3]=

Mensagens que contenham código são incluídas de forma segura em HoldComplete, permitindo que sejam examinadas antes de serem executadas.
In[4]:=

ChannelSend["example", Unevaluated[Print["hello"]]];
In[5]:=

listener["Message"]
Out[5]=

In[6]:=

listener["Message"] // ReleaseHold

Crie um canal que envie um notebook compactado e abra o notebook recebido em uma nova janela.
In[7]:=

CreateChannel["nb", ChannelPreSendFunction -> (Compress[#1] &),
HandlerFunctions ->
Association[
"MessageReceived" -> (CreateWindow[Uncompress[#Message]] &)]]
Out[7]=

Comece a ouvir no canal.
In[8]:=

listener = ChannelListen["nb"]
Out[8]=

Crie um notebook e envie para o canal.
In[9]:=

nb = DocumentNotebook[{TextCell["My Report", "Section"],
TextCell["Lorem ipsum dolor sit amet:", "Text"],
ExpressionCell[
ContourPlot[x + Sin[x^2 + y^2], {x, -4, 4}, {y, -4, 4},
Contours -> 9, ContourShading -> ColorData[35, "ColorList"]]]},
StyleDefinitions -> FrontEnd`FileName[{"Article"}, "Preprint.nb"],
WindowTitle -> "My Report", Background -> LightOrange]
Out[9]=

In[10]:=

ChannelSend["nb", nb]
Out[10]=

O notebook recebido.
Out[11]=
