Liking cljdoc? Tell your friends :D

csp-clj.protocols.buffer

Buffer protocol for channel storage.

Defines the interface for buffer implementations used by buffered channels. Buffers provide FIFO storage with capacity limits.

Key Concepts for New Developers:

  • Buffers are not thread-safe by design
  • Channels handle synchronization around buffer operations
  • Currently only FixedBuffer is implemented

Implementations:

  • csp-clj.buffers.fixed/FixedBuffer
Buffer protocol for channel storage.

Defines the interface for buffer implementations used by
buffered channels. Buffers provide FIFO storage with capacity
limits.

Key Concepts for New Developers:
- Buffers are not thread-safe by design
- Channels handle synchronization around buffer operations
- Currently only FixedBuffer is implemented

Implementations:
- csp-clj.buffers.fixed/FixedBuffer
raw docstring

csp-clj.protocols.channel

Core channel protocol defining the fundamental operations for all channel implementations in csp-clj.

This protocol abstracts over buffered and unbuffered channels, providing a uniform interface for:

  • Synchronous/asynchronous value transfer
  • Channel lifecycle management
  • Timeout support for blocking operations

Thread Safety: All methods in this protocol are thread-safe and may be called concurrently from multiple virtual threads.

Core channel protocol defining the fundamental operations for all
channel implementations in csp-clj.

This protocol abstracts over buffered and unbuffered channels,
providing a uniform interface for:
- Synchronous/asynchronous value transfer
- Channel lifecycle management
- Timeout support for blocking operations

Thread Safety:
All methods in this protocol are thread-safe and may be called
concurrently from multiple virtual threads.
raw docstring

csp-clj.protocols.multiplexer

Protocol for channel multiplexers (mults).

A multiplexer distributes values from a source channel to multiple tap channels concurrently. Each value from the source is sent to all registered taps.

Key Characteristics:

  • Broadcast semantics: all taps receive all values
  • Concurrent dispatch: each tap gets its own virtual thread
  • Backpressure: blocks until all taps accept each value
  • Lifecycle management: taps can auto-close with source

Use Case: Broadcasting messages to multiple consumers, fan-out patterns, event distribution.

Protocol for channel multiplexers (mults).

A multiplexer distributes values from a source channel to multiple
tap channels concurrently. Each value from the source is sent to
all registered taps.

Key Characteristics:
- Broadcast semantics: all taps receive all values
- Concurrent dispatch: each tap gets its own virtual thread
- Backpressure: blocks until all taps accept each value
- Lifecycle management: taps can auto-close with source

Use Case: Broadcasting messages to multiple consumers,
fan-out patterns, event distribution.
raw docstring

csp-clj.protocols.publisher

Protocol for topic-based publish/subscribe channels.

A publisher routes values from a source channel to subscriber channels based on a topic function. Each topic maintains its own independent distribution mechanism.

Key Characteristics:

  • Topic routing: values routed based on topic-fn(value)
  • Per-topic fan-out: each topic has its own set of subscribers
  • Dynamic subscription: subscribers can join/leave at any time
  • Auto-cleanup: topics with no subscribers are cleaned up

Use Case: Event buses, message routing, category-based distribution (e.g., by event type, user ID, etc.).

Protocol for topic-based publish/subscribe channels.

A publisher routes values from a source channel to subscriber
channels based on a topic function. Each topic maintains its
own independent distribution mechanism.

Key Characteristics:
- Topic routing: values routed based on topic-fn(value)
- Per-topic fan-out: each topic has its own set of subscribers
- Dynamic subscription: subscribers can join/leave at any time
- Auto-cleanup: topics with no subscribers are cleaned up

Use Case: Event buses, message routing, category-based
distribution (e.g., by event type, user ID, etc.).
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close