chan create

Create a reflected channel with the given mode (i.e. readable/writable) and which is implemented using the given ensemble-like command (or command prefix; it may include multiple words).

chan create mode cmdPrefix

If cmdPrefix is "foo bar" (no quotes) and the mode is "read" then the call to initialize the channel (done during chan create) will be:

 foo bar initialize <thechanname> read

[ To do: document the API expected to be used by the implementation command ] The API is documented here: https://www.tcl-lang.org/man/tcl8.5/TclCmd/refchan.htm


Required Subcommands

cmdPrefix initialize channelId mode - Must be supported. Must return list of all subcommands supported (i.e., minimally initialize, finalize and watch).

cmdPrefix finalize channelId - Must be supported. Must not access the channel in any way.

cmdPrefix watch channelId eventSpec - Must be supported. Interacts with chan postevent.

Optional Subcommands

cmdPrefix read channelId count - Non-readable channels do not need this command.

cmdPrefix write channelId data - Non-writable channels do not need this command.

cmdPrefix seek channelId offset base - Non-seekable channels do not need this command. Both chan seek and chan tell use this.

cmdPrefix configure channelId option value

cmdPrefix cget channelId option - If supported, the cgetall subcommand must also be supported.

cmdPrefix cgetall channelId - If supported, the cget subcommand must also be supported.

cmdPrefix blocking channelId mode