Restrict

data class Restrict(val buffer: Int = DefaultBufferSize, val overflow: BufferOverflow = BufferOverflow.SUSPEND) : ActionShareBehavior

Restricts the count of subscription events to 1. Attempting to subscribe to a store that has already been subscribed to will result in an exception. In other words, you will be required to create a new store for each invocation of Store.subscribe.

Repeated subscriptions are not allowed, including lifecycle-aware collection.

Parameters

buffer

How many actions will be buffered when consumer processes them slower than they are emitted

overflow

How actions that overflow the buffer are handled.

See also

BufferOverflow

Constructors

Link copied to clipboard
constructor(buffer: Int = DefaultBufferSize, overflow: BufferOverflow = BufferOverflow.SUSPEND)

Properties

Link copied to clipboard
val buffer: Int
Link copied to clipboard
val overflow: BufferOverflow