cispy

All of the externalCSP functions are gathered here and exported as a whole. This includes core CSP functions for channels and processes, but it also includes buffers, special values, and utility functions.

Source:

Namespaces

Cispy

Type Definitions

altsCallback(data)

Source:

A callback run when a non-blocking alts operation completes. Th evalue that this function recieves is an object with two properties: the value that the alts operation completed with (either the value taken from the channel in a take operation, or true or false in a puts operation), along with the channel where the operation actually took place. This function need not return anything; any return value is ignored.

Parameters:
Name Type Description
data Object

The value returned from the alts operation.

Properties
Name Type Description
value *

The value of the completed operation. If the operation was a take, this is the value that was taken from the channel (or CLOSED if the channel was closed without a value being taken). If the operation was a put, this is true if the put value was taken and false if the channel was closed before that value could be taken.

channel module:cispy/channel~Channel

The channel on which the operation that was completed acted.

exceptionHandler(err) → {*}

Source:

An error handling function. This is used to handle exceptions thrown in processes and transducers. The return value of an exception handler is typically put onto a channel; if the exception happened within a process, it will be put to that process's output channel, and if the exception happened in a transducer, it will be put to the channel to which the transducer is attached.

Parameters:
Name Type Description
err Object

The error object that was thrown to cause the error being handled.

Returns:

A value that will be put onto a channel..

Type
*

nbCallback(value)

Source:

A callback run when a non-blocking channel operation completes. The value that this function receives is identical to what is returned by a blocking call: the value being taken from the channel for a take, or true or false depending on the channel status for a put. It need not return anything; any return value is ignored.

Parameters:
Name Type Description
value *

Either the value taken from the channel, or whether or not a value was successfully put.

transducer(xform) → {module:cispy~transducer}

Source:

A function that transforms data and can be chained to other transducers. This is handled by separate libraries; the only involvement of this library is as a consumer of transducers. A transducer is stepped through each time a value is taken from a channel.

Transducers work by having step functions that are known via protocol, and it is these step functions that take the data to be transformed as arguments. The arguments to the transducers themselves are other transducers that are then composed into a single transducer, which is then returned. These values should not be a concern of a user of this library; just pass a transducer to chan and everything else will be handled.

Parameters:
Name Type Description
xform module:cispy~transducer

A transducer to chain this transducer to.

Returns:

A new transducer chaining this one to xform.

Type
module:cispy~transducer