Skip to content

durability: Use async-channel to allow blocking send#4802

Open
kim wants to merge 1 commit intomasterfrom
kim/durability/async-channel
Open

durability: Use async-channel to allow blocking send#4802
kim wants to merge 1 commit intomasterfrom
kim/durability/async-channel

Conversation

@kim
Copy link
Copy Markdown
Contributor

@kim kim commented Apr 14, 2026

The previous approaches would either:

  • panic when the queue becomes full, as append_tx is run inside the context of a LocalSet, which is basically a glorified current thread runtime
  • deadlock because the receiver runtime has no way of notifiying the sender of freed capacity in the channel

async-channel handles wait queues and notifications internally, so can be used freely from either blocking or async contexts.

This may come at different performance characteristics, but I haven't measured them.

The previous approaches would either:

- panic when the queue becomes full, as `append_tx` is run inside the
  context of a `LocalSet`, which is basically a glorified current thread
  runtime
- deadlock because the receiver runtime has no way of notifiying the
  sender of freed capacity in the channel

`async-channel` handles wait queues and notifications internally, so can
be used freely from either blocking or async contexts.

This _may_ come at different performance characteristics, but I haven't
measured them.
@kim kim requested a review from joshua-spacetime April 14, 2026 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant