Scopes designate channel instances on the unified bus. Channel instances are themselves hierarchical, hence scopes also reflect this structure.
There is a string-based notation for scopes based on UNIX/URL paths. For example:
/a/b/c/
This scope designates the channel /a/b/c/ which is a sub-channel of the channels designated by:
/a/b/
/a/
/
/ is sometimes called “root-scope”.
Generally, a scope string is valid if it matches the regular expression /([-_a-zA-Z0-9]+/)*.
Note
For convenience, the final / in scope strings may be omitted when specifying scopes in user interfaces. However, when scope strings are used as keys in associative arrays or in network protocols, scope strings have to be normalized such that they contain the terminating /.
Important
Scope strings are currently case-sensitive, but this may change in future releases. We recommend using all-lowercase scope strings.
The scope /__rsb/ and its subscopes are reserved for implementation purposes and should not be used for user-level communication.
When designing communication patterns based on RSB, it is sometimes necessary to derive components of scopes from arbitrary strings. This section defines a procedure that should be used when such a derivation is needed:
Note
Of course, this procedure does not necessarily produce distinct scope components from distinct strings. This possibility of clashes has to be taken into account.
Language | File(s) |
---|---|
C++ | “0.12” branch of https://code.cor-lab.org/git/rsb.git.cpp at src/rsb/Scope.{h,cpp} |
Java | /../rsb-java/src/rsb/Scope.java |
Python | /../rsb-python/rsb/__init__.py |
Common Lisp | /../rsb-cl/src/scope.lisp |