Simple Message layout
parent
1389ca88cf
commit
d11d256761
|
@ -10,6 +10,7 @@ It reduces work of implementation, and all implementations can use the functions
|
|||
- **OCAP** security
|
||||
- **HMAC** message verification
|
||||
|
||||
## Format
|
||||
```rust
|
||||
// Different possible types of actors (more to be added)
|
||||
enum ActorType {
|
||||
|
@ -81,8 +82,31 @@ trait DataInterface { // Necessary data functions
|
|||
**TODO**
|
||||
|
||||
## Messages
|
||||
**TODO**
|
||||
- [postcard](https://lib.rs/crates/postcard) for message passing
|
||||
- Priority Queue for processing multiple messages, while dealing with higher-priority ones first
|
||||
|
||||
```rust
|
||||
enum ProcessCode {
|
||||
Exit, // Exit the process
|
||||
Save, // Save data
|
||||
Clear, // Clear data
|
||||
Restart, // Restart process
|
||||
}
|
||||
|
||||
enum MessageType {
|
||||
Ping(String), // Simple test if we can send/recieve a message
|
||||
FilesystemUpdate(gravitas::FileOperation), // We want to operate on the filesystem
|
||||
GraphicsUpdate(photon::GraphicsOperation), // Update a graphics window
|
||||
TextUpdate(String), // Send some text (text mode only)
|
||||
ProcessUpdate(ProcessCode), // Send some info about an operation to be done on the current process. Usually kernel -> exe
|
||||
}
|
||||
|
||||
struct Message {
|
||||
m_type: MessageType, // Message type & content
|
||||
priority: u8, // For priority queueing
|
||||
sender: Uuid, // Who is sending the message
|
||||
recipient: Uuid, // Who the message is meant for
|
||||
}
|
||||
```
|
||||
|
||||
### Latency
|
||||
|
|
Loading…
Reference in New Issue