-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Norbert Fabritius
committed
Sep 13, 2023
1 parent
9430bf7
commit 3562504
Showing
10 changed files
with
122 additions
and
92 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
pub mod jobs; | ||
pub mod limits; | ||
pub mod queues; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use crate::common::jobs::{Request, Response}; | ||
|
||
#[derive(Clone, Eq, PartialEq, Debug)] | ||
pub enum Error { | ||
/// No [Channel] found for given ID. | ||
UnknownChannelId, | ||
/// Attempted to push to a full queue. | ||
QueueFull, | ||
/// Failed to enqueue into a queue | ||
Enqueue, | ||
/// Sink was not ready | ||
NotReady, | ||
} | ||
|
||
/// Sink where the responses from the Core can be pushed to | ||
pub trait ResponseSink<'data> { | ||
/// Send a [Response] to the client through this sink. | ||
fn send(&mut self, response: Response<'data>) -> Result<(), Error>; | ||
fn ready(&self) -> bool; | ||
} | ||
|
||
/// Sink where the requests to the Core can be pushed to | ||
pub trait RequestSink<'data> { | ||
/// Send a [Request] to the client through this sink. | ||
fn send(&mut self, request: Request<'data>) -> Result<(), Error>; | ||
fn ready(&self) -> bool; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.