Discussion:
How to ground Manifold streams?
m***@metosin.fi
2016-09-16 06:54:44 UTC
Permalink
I'd like to port some code that uses Aleph 0.3/Lamina to the latest Aleph
and Manifold. The code is simple: there's a Lamina channel to which some
messages are written and the messages are then streamed to clients via
Aleph HTTP server. I replaced the channel with a Manifold stream and
upgraded the Aleph initialization code and everything seems to work.

The Lamina channel is grounded, so if there are no clients, the messages
are dropped instead of being queued. I expected Manifold API to have a
ready-made way to ground the stream, but did not find such thing. What I
did was `(s/consume (constantly nil) my-channel)`. Since I'm not very
familiar with Lamina, Manifold, or the code I'm working on, I would like to
double-check this. Is this the right way to do it? Or is this a bad idea?


Thanks in advance,
Miikka
--
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aleph-lib+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Zach Tellman
2016-09-16 13:59:49 UTC
Permalink
That will give you the equivalent functionality to `ground`, but you might
consider looking at the functionality in `manifold.bus`, specifically
sending the messages via `publish!`, potentially wrapping the call inside
`consume-async`, if you want to exert backpressure when someone's
publishing too much.
Post by m***@metosin.fi
I'd like to port some code that uses Aleph 0.3/Lamina to the latest Aleph
and Manifold. The code is simple: there's a Lamina channel to which some
messages are written and the messages are then streamed to clients via
Aleph HTTP server. I replaced the channel with a Manifold stream and
upgraded the Aleph initialization code and everything seems to work.
The Lamina channel is grounded, so if there are no clients, the messages
are dropped instead of being queued. I expected Manifold API to have a
ready-made way to ground the stream, but did not find such thing. What I
did was `(s/consume (constantly nil) my-channel)`. Since I'm not very
familiar with Lamina, Manifold, or the code I'm working on, I would like to
double-check this. Is this the right way to do it? Or is this a bad idea?
Thanks in advance,
Miikka
--
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aleph-lib+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...