sigq

Check-in Differences
Login

Check-in Differences

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Difference From sigq-0.13.2 To sigq-0.13.3

2023-09-15
13:32
Implement WeakPusher, a weak reference to Pusher objects. check-in: bd3e071eea user: jan tags: trunk
2023-07-27
01:26
Release maintenance. check-in: 727d7924a6 user: jan tags: sigq-0.13.3, trunk
01:21
Fix premature Puller stale error bug. check-in: 68dd3c42ad user: jan tags: trunk
2023-07-26
19:54
Documentation udates. Hide push and pull modules from public. check-in: b485d7b118 user: jan tags: sigq-0.13.2, trunk
2023-07-25
01:49
Release maintenance. check-in: 052111cfd8 user: jan tags: sigq-0.13.1, trunk

Changes to Cargo.toml.

1
2
3

4
5
6
7
8
9
10
1
2

3
4
5
6
7
8
9
10


-
+







[package]
name = "sigq"
version = "0.13.2"
version = "0.13.3"
authors = ["Jan Danielsson <jan.danielsson@qrnch.com>"]
edition = "2021"
license = "0BSD"
categories = [ "asynchronous", "concurrency", "data-structures" ]
keywords = [ "threads", "sync" ]
repository = "https://repos.qrnch.tech/pub/sigq"
description = "Queue that signals waiting consumers about node availability"

Changes to src/pull.rs.

22
23
24
25
26
27
28
29

30
31
32
33
34
35
36
22
23
24
25
26
27
28

29
30
31
32
33
34
35
36







-
+







  /// Returns `Err(StaleErr)` if there are no more items in queue and there are
  /// no more [`Pusher`](super::Pusher) objects associated with this
  /// `Puller`.
  #[cfg_attr(feature = "inline-more", inline)]
  pub fn pop(&self) -> Result<I, StaleErr> {
    let mut inner = self.0.inner.lock();
    loop {
      if inner.npushers == 0 {
      if inner.q.is_empty() && inner.npushers == 0 {
        break Err(StaleErr);
      } else {
        match inner.q.pop_front() {
          Some(node) => {
            break Ok(node);
          }
          None => {
127
128
129
130
131
132
133
134

135
136
137
138
139
140
141
127
128
129
130
131
132
133

134
135
136
137
138
139
140
141







-
+







    mut self: Pin<&mut Self>,
    ctx: &mut Context<'_>
  ) -> Poll<Self::Output> {
    let mut inner = self.ctx.inner.lock();
    match inner.q.pop_front() {
      Some(node) => Poll::Ready(Ok(node)),
      None => {
        if inner.npushers == 0 {
        if inner.q.is_empty() && inner.npushers == 0 {
          // No more nodes and no more pushers, so return None
          Poll::Ready(Err(StaleErr))
        } else {
          // Generate a unique identifier for this waker
          let id = loop {
            let id = self.ctx.idgen.fetch_add(1, Ordering::SeqCst);
            // Make sure it is non-zero and unique

Changes to www/changelog.md.

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
61
62
63
64
65
66
67
68
69
70
71
72
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
61
62
63
64
65
66











-
+

-
+
+
+
+
+
+
+





-
-



-
-




-
-



-
-





-
-



















-
-







# Change Log

## [Unreleased]

### Added

### Changed

### Removed


## [0.13.2] - 2023-07-26
## [0.13.3] - 2023-07-27

### Added
### Changed

- Fixed bug that caused `Puller` to return `Err(StaleErr)` even though nodes
  still remain in the queue.


## [0.13.2] - 2023-07-26

### Changed

- Documentation updates.

### Removed


## [0.13.1] - 2023-07-25

### Added

### Changed

- When the last `Puller` is dropped, clear the queue.

### Removed


## [0.13.0] - 2023-07-25

### Added

### Changed

- `Pusher::push()` will return `Err(StaleErr)` if there are no more associated
  `Puller`s.

### Removed


## [0.12.0] - 2023-07-24

### Added

- Add an `inline-more` feature (enabled by default).

### Changed

- Split `Queue` into `Pusher` and `Puller` end-points.
  - When taking nodes off the queue using `Puller`, return a `Result` which can
    indicate an error if no nodes remain and there are no more `Pushers`
    associated with the queue (implied: If no pushers remain, no new nodes will
    be added, so the queue is effectively dead).
- Dependencies updated:
  - `indexmap` updated to `2.0.0`
- Use Rust edition 2021.
- Bump MSRV to 1.64 (based on MSRV in `indexmap`)

### Removed


## [0.11.0] - 2022-09-09

### Added

- Add a `Default` implementation for `Queue`.
- Explicitly set MSRV is `1.36`