Configuration api
Configuration API
In hyrrokkin, package configurations are implemented using a python class which implements methods described in hyrrokkin_engine.configuration_interface.ConfigurationInterface
:
ConfigurationInterface
Source code in hyrrokkin_engine/configuration_interface.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
|
__init__(services)
abstractmethod
Create an instance of this Configuration
Parameters:
Name | Type | Description | Default |
---|---|---|---|
services
|
ConfigurationService
|
an object providing useful services, for example to get or set property values |
required |
Source code in hyrrokkin_engine/configuration_interface.py
30 31 32 33 34 35 36 37 38 |
|
close_client(session_id, client_name)
abstractmethod
Called when a client is detached from the configuration
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session_id
|
str
|
a unique identifier for the session to which the client belongs |
required |
client_name
|
str
|
the name of the client, matching details in the schema |
required |
Source code in hyrrokkin_engine/configuration_interface.py
108 109 110 111 112 113 114 115 116 117 |
|
close_session(session_id)
abstractmethod
Called when a session closes
Source code in hyrrokkin_engine/configuration_interface.py
88 89 90 91 92 93 |
|
create_node(node_type_id, service)
abstractmethod
async
Create a node which is defined within this package
:param node_type_id: the id of the node type (a valid key in the schema's node_types dictionary) :param service: a service instance which will provide services to the node
:return: an instance of the node
Source code in hyrrokkin_engine/configuration_interface.py
47 48 49 50 51 52 53 54 55 56 57 |
|
decode(encoded_bytes, link_type)
abstractmethod
Decode binary data into a value valid for a particular link type
:param encoded_bytes: binary data to decode :param link_type: the link type associated with the value :return: decoded value
Source code in hyrrokkin_engine/configuration_interface.py
59 60 61 62 63 64 65 66 67 68 |
|
encode(value, link_type)
abstractmethod
Encode a value associated with a link type to binary data
:param value: the value to encode :param link_type: the link type associated with the value :return: binary data that encodes the value
Source code in hyrrokkin_engine/configuration_interface.py
70 71 72 73 74 75 76 77 78 79 |
|
load()
abstractmethod
async
Called after construction. Load any resources associated with this Configuration
Source code in hyrrokkin_engine/configuration_interface.py
40 41 42 43 44 45 |
|
open_client(session_id, client_name, client_options, client_service)
abstractmethod
Called when a client is attached to the configuration
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session_id
|
str
|
a unique identifier for the session to which the client belongs |
required |
client_name
|
str
|
the name of the client, matching details in the schema |
required |
client_options
|
dict
|
a set of parameters accompanying the connection |
required |
client_service
|
ClientServiceInterface
|
a service instance allowing messages to be sent to and received from the client |
required |
Source code in hyrrokkin_engine/configuration_interface.py
95 96 97 98 99 100 101 102 103 104 105 106 |
|
open_session(session_id)
abstractmethod
Called when a new session starts
Source code in hyrrokkin_engine/configuration_interface.py
81 82 83 84 85 86 |
|