• Publicity: Public Only All

message-relay-procs.tcl

Generic MessageRelay procs Provide means to publish a subscription key and let clients write to these keys. These functions are used e.g. by the chat.

This file defines the following Objects and Classes: ::xo::MessageRelay[i]

Location:
packages/xotcl-core/tcl/message-relay-procs.tcl
Created:
2019-02-23
Author:
Gustaf Neumann

Procedures in this file

Detailed information

Class ::xo::MessageRelay (public)

 ::nx::Class ::xo::MessageRelay[i]

Generic Message Relay class

Partial Call Graph (max 5 caller/called nodes):
%3 security::csp::nonce security::csp::nonce (public) Class ::xo::MessageRelay Class ::xo::MessageRelay Class ::xo::MessageRelay->security::csp::nonce

Testcases:
No testcase defined.

xo::MessageRelay method can_be_used (public)

 <instance of xo::MessageRelay[i]> can_be_used

Check, if a message relay can be used in the current configuration.

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

xo::MessageRelay method encode_message (public)

 <instance of xo::MessageRelay[i]> encode_message mode msg

Provide different "encoding" depending on the mode. Notice that for one chat, multiple clients might have difference modes, since the modes are determined at also by the capabilities of the client browser. So the incoming message has to be recoded multiple times.

Parameters:
mode
msg

Partial Call Graph (max 5 caller/called nodes):
%3 security::csp::nonce security::csp::nonce (public) xo::MessageRelay instproc encode_message xo::MessageRelay instproc encode_message xo::MessageRelay instproc encode_message->security::csp::nonce

Testcases:
No testcase defined.

xo::MessageRelay method send_to_subscriber (public)

 <instance of xo::MessageRelay[i]> send_to_subscriber key msg

Send a message to a service identified by the key (communication hub).

Parameters:
key - id for an existing communication hub
msg - message to be sent

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

xo::MessageRelay method subscribe (public)

 <instance of xo::MessageRelay[i]> subscribe [ -initmsg initmsg ] \
    [ -mode mode ] key

Subscribe to a service identified by a key.

Switches:
-initmsg
(optional)
optional message to be sent, when subscription happens
-mode
(defaults to "default") (optional)
optional mode
Parameters:
key - unique id for a (potentially new communication hub)

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

xo::MessageRelay method sweep (public)

 <instance of xo::MessageRelay[i]> sweep key

Check existing subscriptions and clean stale ones.

Parameters:
key - key of the communication hub

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.
[ show source ]