com.manigfeald.machinate.protocols

AsymmetricExchange

protocol

An exchange is a place where two threads of control can meet and
exchange values. There is a left side and right side. sends on the
left are matched with sends on the right.

members

send-left

(send-left _ value)
return an event that on sync waits for a corresponding send-right and
returns the value it sent.

send-right

(send-right _ value)
return an event that on sync waits for a corresponding send-left and
returns the value it sent.

Buffer

protocol

members

add-item

(add-item buf item)
adds the give item to the given buffer

full?

(full? buf)
returns true if the given buffer is full

peek-item

(peek-item buf)
returns the item at the top of the buffer or nil if empty

pop-item

(pop-item buf)
pops the item off the top of the buffer

Channel

protocol

members

close!

(close! _)

Event

protocol

members

try-event

(try-event event resume resume-with-error control nack-group)
internal function for syncing

Nackable

protocol

members

check-nack-group

(check-nack-group event nack-group)

PubSub

protocol

members

subscribe

(subscribe _ topic channel close?)

unsubscribe

(unsubscribe _ topic channel)

QuasiEvent

protocol

members

push-down

(push-down event ctor lst)
Given an event, which is possible a tree built using repeated
applications of combinators, turn the tree into a "disjunctive normal
form" list of possible events to synchronize on

ReceiveChannel

protocol

members

receive-it

(receive-it _)

SendChannel

protocol

members

send-it

(send-it _ it)

Syncable

protocol

members

-sync

(-sync event)
register interest in the occurence of this event