States
State
Bases: BaseModel
Holds variables for the nodes of serializable types. Arbitrary types are not allowed.
The state is copied for each parallel node and merged after the node has finished. Therefore, the state is not shared between nodes and operations are safe.
Parallel changes of the same variable will be detected as a conflict and raise an error.
Implements pydantic's BaseModel.
Source code in src/edgygraph/states.py
8 9 10 11 12 13 14 15 16 17 18 19 | |
Shared
Bases: BaseModel
Holds shared variables for the nodes of any type.
The shared state is shared between all parallel nodes and operations are not safe without using the Lock.
The lock can be accessed via shared.lock.
Implements pydantic's BaseModel with arbitrary types allowed.
Source code in src/edgygraph/states.py
22 23 24 25 26 27 28 29 30 31 32 | |
StateAttribute
Bases: BaseModel
Holds variables of serializable types for the nodes. Arbitrary types are not allowed.
Simplifies composition in states.
Source code in src/edgygraph/states.py
35 36 37 38 39 40 41 | |
SharedAttribute
Bases: BaseModel
Holds shared variables of any type for the nodes.
Simplifies composition in shared states.
Source code in src/edgygraph/states.py
43 44 45 46 47 48 49 | |
Stream
Bases: ABC, AsyncIterator[T]
Standardized wrapper interface for streams of data.
Set the type of the data that the stream will yield with the generic type parameter T.
Implements an async iterator and async context manager.
Source code in src/edgygraph/states.py
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 | |