![]() |
License / Documentation home / Help and feedback | ![]() |
As of version 2.0, the Hub does not require Hub programs to run. The Hub still requires a configuration file, because it still must know how to do its logging and how to contact servers. In this document, we discuss some of the options available to the developer for scriptless interaction.
When the Hub receives a message and there is no program to claim it, the Hub searches its list of servers for a server which has declared an operation which is identical to the message name. Let's say the Hub receives a message of this form:
{c parseIf there is a Hub program named parse, that program will claim the message and process it, regardless of whether there's an operation named parse. In the following program file, the message sent to the parser server will be parse_string, not parse:
:input_string "I want to fly to Denver" }
SERVER: parserHowever, if there were no program named parse, the Hub would pass the incoming message directly to one of the providers for the parse operation, and the parse operation would be invoked. The specific provider is chosen according to the rules for provider selection.
OPERATIONS: parse parse_stringPROGRAM: parse
RULE: :input_string --> parser.parse_string
IN: :input_string
OUT: :frame
What this means is that the developer doesn't need to choose fully scripted or fully scriptless; it's possible to construct a "partially scripted" program file, where some new messages are claimed by programs and others are not.
First, the TIMESTAMP: declaration now applies indiscriminately to operations and programs:
SERVER: parserIn our example here, the log will contain a timestamp for when the parse request arrived on the Hub, as well as when the parse_string operation was sent to the parser server. Because timestamps are indiscriminate, the program doesn't have to be present in order for a timestamp to happen; so if the parse program is removed, the incoming timestamp will still happen.
OPERATIONS: parse parse_stringTIMESTAMP: parse parse_string
PROGRAM: parse
RULE: :input_string --> parser.parse_string
IN: :input_string
OUT: :frame
Second, it is now possible to add LOG_IN: and LOG_OUT: declarations outside the scope of a rule, and the new MESSAGE: declaration supports in and out logging for scriptless rules. So either of the following program files will result in a time being recorded for the incoming parse message:
SERVER: parserIn this way, all the possibilities for logging are still available for scriptless interaction.
OPERATIONS: parse parse_stringTIMESTAMP: parse parse_string
PROGRAM: parse
LOG_IN: :input_stringRULE: :input_string --> parser.parse_string
IN: :input_string
OUT: :frame--------------------------------------------------
SERVER: parser
OPERATIONS: parse parse_stringTIMESTAMP: parse parse_string
MESSAGE: parse
LOG_IN: :input_string
![]() |
License / Documentation home / Help and feedback | ![]() |