com.manigfeald.machinate

alts

(alts events)
A work-a-like for clojure.core.async/alts!. Given a collection of
events returns a new event that when sync'ed chooses one event and
returns [event-value event].

always

Event that has always already occured. Synchronization always succeeds
immediately. Value of the event is true.

barrier

(barrier f)
Given a function f, applies f to a function g and an event e. e becomes
occurs when g is invoked and has the value `true`. returns the result of invoking f.

buffered-channel

(buffered-channel buffer-or-n)(buffered-channel buffer-or-n xform)(buffered-channel buffer-or-n xform ex-handler)
Create a buffered full duplex channel. The buffer allows for senders
to add to the channel without waiting for a receiver until the
buffer's capacity is reached. Buffered channels optional can have a
transducer (xform) which transforms values that flow through the
channel. If a transducer is specified, optional an exception halder
can be specified to handle any exceptions that may arise.

channel

(channel)
Returns full duplex channel, both a SendChannel and a ReceiveChannel

choice

(choice evts)
Takes a collection of events, and non-deterministically selects one on
synchronization by defaults.

close!

(close! channel)
Close a channel.

constantly

(constantly value)
Returns an event that is immediatly synchronizable with the value value

constantly-error

(constantly-error value)
Returns an event that is immediatly synchronizable with the error value

dropping-buffer

(dropping-buffer capacity)
A dropping buffer for buffered-channel. Always accepts inputs, but
inputs are silently dropped if the buffer is full.

fixed-size-buffer

(fixed-size-buffer capacity)
A fixed size buffer for buffered-channel. Accepts inputs until full.

full-duplex

(full-duplex send-channel receive-channel)
Given a SendChannel and a ReceiveChannel return a single channel that
is both send and receivable.

guard

(guard f)
Takes a function of no arguments f, returns an event E, before E is
synchronized on, f will be invoked, and E replaced with the event
returned by f.

middleware

(middleware try-event-transform check-nack-group-transform push-down-transform target)
Middleware smart constructor for building events. Middleware wraps an
event, passing protocol calls down with the opportunity to intercept
and make changes. The middleware smart constructor can collapse
multiple middlewares into a single middleware via function
composition.

nack

(nack f)
Like guard, but f is passed an event G. G will occur if on
synchronization, the chosen event is not the one returned by f.

ordered-choice

(ordered-choice evts)
Takes a collection of events, and attempts to select
event to synchronize on in order.

pubsub

(pubsub input topic-fn)
A pubsub allows messages to be sent to topics. input is a channel of
messages, topic-fn is message -> topic. All listeners to a topic are
sent messages in parallel. The pubsub will not move on to the next
message until all listeners have recieved a given message.

receive

(receive channel)
Creates an event where synchronization completes after receivng a value
via the given channel or the channel is closed. Returns the received
value or nil.

receive-only

(receive-only channel)
Given a full duplex channel return a channel that is only a
ReceiveChannel

send

(send channel value)
Creates an event where synchronization completes after the given value
has been sent via the given channel, or after the given channel
closes. Returns true or false

send-only

(send-only channel)
Given a full duplex channel return a channel that is only a
SendChannel

sliding-buffer

(sliding-buffer capacity)
A sliding buffer for buffered-channel. Always accepts inputs, but
drops the oldest item if the buffer is full.

sub

(sub ps topic channel)(sub ps topic channel close?)
Given a pubsub add a channel as a listener to a given topic. Returns
an event that must be synchronized on. After that event occurs the
  listener has been added to the pubsub. If close? is true then the
  listener channel will be closed if the input to the pubsub is
  closed.

sub!

sync!

(sync! evt)(sync! evt callback)
Run a callback after the given event occurs. Returns a
CompletableFuture (or whatever the platform supplied promise like
type is) that will be completed after the event occurs.

sync!!

(sync!! evt)
Stop and wait for the given event to occur

timeout

(timeout delay)
Given a delay in milliseconds, returns an event that doesn't
synchronize until after that delay has elapsed. Value of the event
is true.

unsub

(unsub ps topic channel)
Remove a channel as a listener for the given topic from a
pubsub. Returns an event that must be synchronized on.

unsub!

watch-reference

(watch-reference r value)
Return an event that syncs when the given watchable clojure reference
type (refs,atoms,agents) has the given value. Event has the value
true.

watch-reference1

(watch-reference1 r test)
Return an event that occurs when the given watchable clojure
reference's value is such that (test value) is truthy. Event has the
value true.

wrap

(wrap evt f)
Wraps the post synchronization action f around the event evt

wrap-handler

(wrap-handler evt f)
Wrap an error handler around an event. Handlers errors coming out of
the event itself, or any errors arising from other wrappings of the
event.