You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`hololinked.core`| Definition of [`Thing`](thing/index.md) class, [`Property`](property/index.md), [`Action`](action/index.md) and [`Event`](event/index.md) classes, [`StateMachine`](state-machine/state-machine.md), [`Logger`](thing/logger.md) & [`RPCServer`](rpc-server/rpc-server.md)|
6
+
|`hololinked.serializers`| Serializers for different data formats (JSON, MessagePack, etc.) and [`Serializers`](serializers/index.md) singleton. |
7
+
|`hololinked.server`| Protocol specific server implementations |
8
+
|`hololinked.client`|[`ObjectProxy`](clients/object-proxy.md) and protocol specific client implementations, client abstractions and [`ClientFactory`](clients/base.md). |
9
+
|`hololinked.param`| Copy of `param` library with implementation specific modifications. |
10
+
|`hololinked.storage`| Database clients for data persistence. |
11
+
|`hololinked.td`| Thing Description/[ThingModel](td/tm.md) parsing and generation. |
This type of validation is made possible by constructing a pydantic model from the type annotations.
78
74
79
-
For more complex payload validation, one can use JSON schema or pydantic models (directly).
80
-
81
-
=== "JSON Schema"
82
-
83
-
```python
84
-
```
85
-
86
-
=== "Pydantic Model"
87
-
88
-
```python
89
-
```
75
+
For more complex payload validation, one can use JSON schema or pydantic models (directly). Examples are already included
76
+
in the [handbook](../beginners-guide/articles/actions.md#payload-validation).
90
77
91
78
The output payload is not validated.
92
79
93
80
## Execution Control
94
81
95
-
Execution control of operations (like `invokeAction`) can be offered in three different ways:
82
+
Execution control of operations (like `invokeaction`) can be offered in three different ways:
96
83
97
84
- synchronous - queued one after another, default behaviour of **both** properties and actions
98
85
-`Thing` object is not manipulated simultaneously by multiple operations in multiple threads by a remote client, its a fundamental assumption based on the OOP paradigm
99
-
- prevents incompatible physical actions in the world from running at the same time on the same device
100
86
- maximizes thread safety increasing suitability of runtime for hardware engineers
87
+
- prevents incompatible physical actions in the world from running at the same time on the same device
101
88
- threaded actions
102
89
- not queued, runs immediately when action is called
103
90
- allows multiple actions to run simultaneously
@@ -113,9 +100,9 @@ flowchart TD
113
100
B -- No --> D[Bind to instance]
114
101
C --> E{Action type}
115
102
D --> E
116
-
E -- Synchronous --> F[Queue action,<br/>run sequentially]
117
-
E -- Threaded --> G[Run action in a new thread]
118
-
E -- Async --> H[Create asyncio task<br/>if requested]
103
+
E -- synchronous --> F[Queue action,<br/>run sequentially]
104
+
E -- threaded --> G[Run action in a new thread]
105
+
E -- asyncio --> H[Create asyncio task]
119
106
F --> I[Validate payload<br/> against the action schema, <br/>Spread payload as arguments]
120
107
G --> J[Validate payload<br/> against the action schema, <br/>Spread payload as arguments]
121
108
H --> K[Validate payload<br/> against the action schema, <br/>Spread payload as arguments]
@@ -126,5 +113,5 @@ flowchart TD
126
113
```
127
114
128
115
This scheduling control may need to be implemented in a separate RPC layer or similar. See the [ZMQ RPC layer](zmq.md) for more details.
129
-
130
-
116
+
The payload validation step comes after the scheduling decision, as schedulers have higher precedence in the RPC call stack, although
0 commit comments