proxy.golang.org : github.com/gammazero/chanqueue
Package chanqueue implements a queue that uses channels for input and output to provide concurrent access to a re-sizable queue. This allows the queue to be used like a channel. Closing the input channel closes the output channel when all queued items are read, consistent with channel behavior. In other words chanqueue is a dynamically buffered channel with up to infinite capacity. ChanQueue also supports circular buffer behavior when created using `NewRing`. When the buffer is full, writing an additional item discards the oldest buffered item. When using an unlimited buffer capacity, the default, use caution as the buffer is still limited by the resources available on the host system. The behavior of chanqueue differs from the behavior of a normal channel in one important way: After writing to the In() channel, the data may not be immediately available on the Out() channel (until the buffer goroutine is scheduled), and may be missed by a non-blocking select. This implementation is based on ideas/examples from: https://github.com/eapache/channels
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/gammazero/chanqueue
Keywords:
channel
, queue
, unbounded-channel
License: MIT
Latest release: 2 months ago
First release: 6 months ago
Namespace: github.com/gammazero
Stars: 1 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 4 days ago