The package exports eight commands, as specified below. Note that when the package is used from within
Tcl 8.5+ all the higher commands are ensembles, i.e. the :: separators can be replaceed by spaces.
::uevent::bindtageventcommand
Using this command registers the command prefix to be triggered when the event occurs for the tag.
The result of the command is an opaque token representing the binding. Note that if the same
combination of <tag,event,command> is used multiple times the same token is returned by every
call.
The signature of the command prefix is
commandtageventdetails
where details contains the argument(s) of the event. Its contents are event specific and have to be
agreed upon between actual event generator and consumer. This package simply transfers the information
and does not perform any processing beyond that.
::uevent::unbindtoken
This command releases the event binding represented by the token. The token has to be the result
of a call to ::uevent::bind. The result of the command is the empty string.
::uevent::generatetagevent ?details?
This command generates an event for the tag, triggering all commands bound to that combination.
The details argument is simply passed unchanged to all event handlers. It is the responsibility of
the code generating and consuming the event to have an agreement about the format and contents of
the information carried therein. The result of the command is the empty string.
Note that all bound commands are triggered, independently of each other. The event handlers cannot
assume a specific order. They are also not called synchronously with the invokation of this
command, but simply put into the event queue for processing when the system returns to the event
loop.
Generating an event for an unknown tag, or for a <tag,event> combination which has no commands
bound to it is allowed, such calls will be ignored.
::uevent::list
In this form the command returns a list containing the names of all tags which have events with
commands bound to them.
::uevent::listtag
In this format the command returns a list containing the names of all events for the tag with
commands bound to them. Specifying an unknown tag, i.e. a tag without event and commands, will
cause the command to throw an error.
::uevent::listtagevent
In this format the command returns a list containing all commands bound to the event for the tag.
Specifying an unknown tag or unknown event, will cause the command to throw an error.
::uevent::watch::tag::addpatterncommand
This command sets up a sort of reverse events. Events generated, i.e. the command prefix invoked,
when observers bind to and unbind from specific tags.
Note that the command prefix is only invoked twice per tag, first when the first command is bound
to any event of the tag, and second when the last command bound to the tag is removed.
The signature of the command prefix is
{*}commandboundtag{*}commandunboundtag
The result of the command is a token representing the watcher.
::uevent::watch::tag::removetoken
This command removes a watcher for (un)bind events on tags.
The result of the command is the empty string.
::uevent::watch::event::addtag_patternevent_patterncommand
This command sets up a sort of reverse events. Events generated, i.e. the command prefix invoked,
when observers bind to and unbind from specific combinations of tags and events.
Note that the command prefix is only invoked twice per tag/event combination, first when the first
command is bound to it, and second when the last command bound to the it is removed.
The signature of the command prefix is
{*}commandboundtagevent{*}commandunboundtagevent
The result of the command is a token representing the watcher.
::uevent::watch::event::removetoken
This command removes a watcher for (un)bind events on tag/event combinations.
The result of the command is the empty string.