Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
event-driven workflows for clojure
Clojure
branch: new

This branch is even with ztellman:new

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src/lamina
test/lamina/test
.gitignore
README.textile
project.clj

README.textile

Lamina provides an event-driven analogue to Clojure’s sequences, called channels. Similar mechanisms have been used in languages such as Go, JoCaml, and C#.

Channels are meant to be a generic interface for the creation and consumption of asynchronous events. Within Aleph, they are used to represent network communication over a variety of protocols.

Sequences can be turned into channels, and vise-versa:

> (def ch (apply channel (range 3)))
<== [0 1 2]
> (channel-seq ch)
(0 1 2)

Channels can be altered using familiar operators:

> (channel 1 2 3)
<== [1 2 3]
> (map* inc *1)
<== [2 3 4]
> (filter* even? *1)
<== [2 4]

Channels can be connected to each other, like UNIX pipes:

> (def a (channel))
<== []
> (def b (channel))
<== []
> (siphon (map* inc a) b)
nil
> (enqueue a 1)
true
> b
<== [2]

To learn more, read the wiki. Complete documentation can be found here.

Something went wrong with that request. Please try again.