crossbar._util¶
Attributes¶
Functions¶
|
|
|
|
|
|
|
Merges two lists. The list being merged must have length >= the |
|
|
|
|
|
|
|
|
|
This returns a name like "module.Class" given either an instance, or a class. |
|
Dump JSON to a string, either pretty printed or not. Returns a Unicode |
|
Extract the XBR network member ID from the WAMP session authid (eg |
|
Returns the first free listening port within the given range. |
|
Returns default local listening address with random port. |
|
Returns random, free listening port. |
|
Returns highlighted text. |
|
|
|
|
|
|
|
|
|
|
|
Returns highlighted text. |
|
|
|
|
|
|
|
|
|
This directly prints to the process controlling terminal (if there is any). |
Module Contents¶
- _deep_merge_list(a, b)[source]¶
Merges two lists. The list being merged must have length >= the list into which is merged.
- Parameters:
a – The list into which the other list is merged
b – The list to be merged into the former
- Returns:
The merged list
- class_name(obj)[source]¶
This returns a name like “module.Class” given either an instance, or a class.
- dump_json(obj, minified=True)[source]¶
Dump JSON to a string, either pretty printed or not. Returns a Unicode string.
- extract_member_oid(details: autobahn.wamp.CallDetails) uuid.UUID[source]¶
Extract the XBR network member ID from the WAMP session authid (eg
member_oid==72de3e0c-ca62-452f-8f09-2d3d30d1b511fromauthid=="member-72de3e0c-ca62-452f-8f09-2d3d30d1b511"- Parameters:
details – Call details.
- Returns:
Extracted XBR network member ID.
- first_free_tcp_port(host='127.0.0.1', portrange=(1024, 65535))[source]¶
Returns the first free listening port within the given range.
- get_free_tcp_address(host='127.0.0.1')[source]¶
Returns default local listening address with random port.
Note: this is _not_ completely race free, as a port returned as free might be used by another process before the caller can bind it.
- Returns:
Default/free listening address:port.
- Return type:
- get_free_tcp_port(host='127.0.0.1')[source]¶
Returns random, free listening port.
Note
This is _not_ completely race free, as a port returned as free is closed before returning, and might then be used by another process before the caller of this function can actually bind it. So watch out ..
- term_print(text)[source]¶
This directly prints to the process controlling terminal (if there is any). It bypasses any output redirections, or closes stdout/stderr pipes.
This can be used eg for “admin messages”, such as “node is shutting down now!”
This currently only works on Unix like systems (tested only on Linux). When it cannot do so, it falls back to plain old print.