diff options
Diffstat (limited to 'crates/thread_worker')
-rw-r--r-- | crates/thread_worker/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/thread_worker/src/lib.rs | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/crates/thread_worker/Cargo.toml b/crates/thread_worker/Cargo.toml index 62d66a1a3..c74b376e2 100644 --- a/crates/thread_worker/Cargo.toml +++ b/crates/thread_worker/Cargo.toml | |||
@@ -6,6 +6,6 @@ authors = ["Aleksey Kladov <[email protected]>"] | |||
6 | 6 | ||
7 | [dependencies] | 7 | [dependencies] |
8 | drop_bomb = "0.1.0" | 8 | drop_bomb = "0.1.0" |
9 | crossbeam-channel = "0.2.4" | 9 | crossbeam-channel = "0.3.5" |
10 | log = "0.4.3" | 10 | log = "0.4.3" |
11 | 11 | ||
diff --git a/crates/thread_worker/src/lib.rs b/crates/thread_worker/src/lib.rs index 12e8bf17e..5e46f62fe 100644 --- a/crates/thread_worker/src/lib.rs +++ b/crates/thread_worker/src/lib.rs | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | use std::thread; | 3 | use std::thread; |
4 | 4 | ||
5 | use crossbeam_channel::{bounded, unbounded, Receiver, Sender}; | 5 | use crossbeam_channel::{bounded, unbounded, Receiver, Sender, RecvError, SendError}; |
6 | use drop_bomb::DropBomb; | 6 | use drop_bomb::DropBomb; |
7 | 7 | ||
8 | pub struct Worker<I, O> { | 8 | pub struct Worker<I, O> { |
@@ -34,10 +34,10 @@ impl<I, O> Worker<I, O> { | |||
34 | self.out | 34 | self.out |
35 | } | 35 | } |
36 | 36 | ||
37 | pub fn send(&self, item: I) { | 37 | pub fn send(&self, item: I) -> Result<(), SendError<I>> { |
38 | self.inp.send(item) | 38 | self.inp.send(item) |
39 | } | 39 | } |
40 | pub fn recv(&self) -> Option<O> { | 40 | pub fn recv(&self) -> Result<O, RecvError> { |
41 | self.out.recv() | 41 | self.out.recv() |
42 | } | 42 | } |
43 | } | 43 | } |