1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
use *;
use PhantomData;
use PopError;
/// Push Message
///
/// The message that will be sent from either producer or the
/// consumer (worker) to enqueue a new task.
///
/// Usage:
/// ```
/// let msg = Push::<i32>::new(10);
/// // or
/// let msg = Push::<&'static str>::new("hello");
/// ```
///
/// Sending this message will put the task to the beginning of
/// the queue.
/// Pop Message
///
/// The message that will be sent from consumers (workers) to
/// get the next available task if exists.
///
/// Usage:
/// ```
/// let msg = Pop::<i32>::new();
/// ```
///
/// A `PopError` will be returned if there's no more task available
/// in the queue.