limqch

Check-in Differences
Login

Check-in Differences

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

Difference From limqch-0.2.1 To limqch-0.2.2

2025-04-19
14:29
Change log. Leaf check-in: 8e4bc38d28 user: jan tags: trunk
14:25
Use limq 0.4.0, but ignore returned iterators. check-in: 6ced735551 user: jan tags: limqch-0.2.2, trunk
2025-04-12
20:53
Fix typos. check-in: 89ce025964 user: jan tags: trunk
20:37
Release maintenance. check-in: 79296cea77 user: jan tags: limqch-0.2.1, trunk
20:35
Use limq 0.3.1 to get bugfix. check-in: ef18178262 user: jan tags: 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 = "limqch"
version = "0.2.1"
version = "0.2.2"
edition = "2024"
license = "0BSD"
# https://crates.io/category_slugs
categories = [ "concurrency" ]
keywords = [ "channel", "bounded" ]
repository = "https://repos.qrnch.tech/pub/limqch"
description = "A channel built on top of limq."
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
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







-
+




-
+












]

# https://doc.rust-lang.org/cargo/reference/manifest.html#the-badges-section
[badges]
maintenance = { status = "actively-developed" }

[dependencies]
limq = { version = "0.3.1" }
limq = { version = "0.4.0" }
parking_lot = { version = "0.12.3" }
wakerizer = { version = "0.1.0" }

[dev-dependencies]
tokio = { version = "1.44.1", features = ["macros", "rt", "rt-multi-thread"] }
tokio = { version = "1.44.2", features = ["macros", "rt", "rt-multi-thread"] }

[package.metadata.docs.rs]
rustdoc-args = ["--generate-link-to-definition"]

[lints.clippy]
all = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }
nursery = { level = "warn", priority = -1 }
cargo = { level = "warn", priority = -1 }

cargo_common_metadata = "allow"

Changes to src/tx.rs.
112
113
114
115
116
117
118
119

120
121
122
123
124
125
126
112
113
114
115
116
117
118

119
120
121
122
123
124
125
126







-
+







  ///
  /// If the channel has a limit, and the limit has been reached, then block
  /// and wait until a [`Receiver`](super::Receiver) has make more room
  /// available on the queue.
  ///
  /// # Errors
  /// [`Error::CantFit`] means the [`Controller`] rejected the node.
  /// [`Error::Closed`] means not [`Receiver`](super::Receiver)s remain.
  /// [`Error::Closed`] means no [`Receiver`](super::Receiver)s remain.
  pub async fn send_async(&self, mut n: T) -> Result<(), Error<T>> {
    // In an ideal world, there'd be a SendFuture that takes in the new node.
    // However, if the queue is full the node needs to be stored somewhere
    // until the task is woken up, and this presents a few annoying challenges.
    //
    // Instead, we'll use a Future that simply waits for there to be space
    // available and when that resolves immediate all the node to the queue.
187
188
189
190
191
192
193
194

195
196
197

198
199
200
201
202
203
204
205
206
207
208
209
210
211

212
213
214
215
216
217
218

219
220
221
222
223
224
225
187
188
189
190
191
192
193

194
195
196

197
198
199
200
201
202
203
204
205
206
207
208
209
210

211
212
213
214
215
216
217

218
219
220
221
222
223
224
225







-
+


-
+













-
+






-
+







  /// Forcibly add an element to the queue.
  ///
  /// If the queue has a limit and the queue is full, then the oldest node will
  /// be removed before the new element is added.
  ///
  /// # Errors
  /// [`Error::CantFit`] means the [`Controller`] rejected the node.
  /// [`Error::Closed`] means not [`Receiver`](super::Receiver)s remain.
  /// [`Error::Closed`] means no [`Receiver`](super::Receiver)s remain.
  pub fn force_send(&self, n: T) -> Result<(), Error<T>> {
    let mut inner = self.sh.inner.lock();
    inner.q.force_push(n)?;
    let _ = inner.q.force_push(n);
    drop(inner);

    // Have a new element in queue -- wake up a waiting receiver
    self.sh.wake_receivers();

    Ok(())
  }

  /// Forcibly add an element to rhe channel, allowing the caller to determine
  /// how overflow is handled.
  ///
  /// # Errors
  /// [`Error::CantFit`] means the [`Controller`] rejected the node.
  /// [`Error::Closed`] means not [`Receiver`](super::Receiver)s remain.
  /// [`Error::Closed`] means no [`Receiver`](super::Receiver)s remain.
  pub fn force_send_oc(
    &self,
    n: T,
    overflow: Overflow
  ) -> Result<(), Error<T>> {
    let mut inner = self.sh.inner.lock();
    inner.q.force_push_oc(n, overflow)?;
    let _ = inner.q.force_push_oc(n, overflow)?;
    drop(inner);

    // Have a new element in queue -- wake up a waiting receiver
    self.sh.wake_receivers();

    Ok(())
  }
Changes to www/changelog.md.
1
2
3
4
5
6
7
8
9
10
11


12
13
14
15
16
17
18
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20











+
+







# Change Log

⚠️  indicates a breaking change.

## [Unreleased]

[Details](/vdiff?from=limqch-0.2.1&to=trunk)

### Added

### Changed

- Use `limq` `0.4.0`.

### Removed

---

## [0.2.1] - 2025-04-12