class ModelChannel(M)

Overview

Publish updates about models to subscribers.

Defined in:

channels/model_channel.cr

Constant Summary

Log = ::Log.for(self)

Instance Method Summary

Instance Method Detail

def publish(model : M) #

Publishes an update about model.

Does not block.


[View source]
def subscribe(model : M, timeout : Time::Span | Nil = nil, &) #

Subscribes to updates about model.

Does not return unless the block raises Stop, raises an exception, or the channel is closed.

A timeout may be specified to ensure the block is called periodically.


[View source]
def subscriptions #

Returns the subscriptions.


[View source]