Issue with the Multi-user Chat app tutorial

22 views
Skip to first unread message

pcxunl...@gmail.com

unread,
Aug 22, 2014, 2:47:18 PM8/22/14
to strati...@googlegroups.com
On the URL <https://conductance.io/examples/chat/> this code occurs at multiple locations:

    var observable = require('sjs:observable');

The problem is that the observable module was moved from sjs to mho, so the above no longer works. The correct code is:

    var observable = require('mho:observable');

Alexander Fritze

unread,
Aug 22, 2014, 6:36:53 PM8/22/14
to strati...@googlegroups.com
Oops, it is actually the other way round... we've moved the observable
module from conductance into the sjs standard lib recently. The
example code already reflects this, but we haven't gotten round to
making new SJS/Conductance releases yet.
I will make sure that we make new releases soon - in the meantime the
github repositories contain the most up to date code!

Thanks for pointing this out - it completely escaped us because we are
mainly working off the github master branches!
> --
> You received this message because you are subscribed to the Google Groups
> "StratifiedJS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to stratifiedjs...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

pcxunl...@gmail.com

unread,
Aug 22, 2014, 6:44:37 PM8/22/14
to strati...@googlegroups.com
Oh, I see. That makes sense. I agree that observables seems like a more general pattern, and so it should be in SJS rather than MHO. In fact, it almost seems strange to me that observables have a special "observe" function which seems to do essentially the same thing as "sequence/transform", except it accepts multiple observables.

Alexander Fritze

unread,
Aug 22, 2014, 7:05:12 PM8/22/14
to strati...@googlegroups.com
On Fri, Aug 22, 2014 at 5:44 PM, <pcxunl...@gmail.com> wrote:
> Oh, I see. That makes sense. I agree that observables seems like a more
> general pattern, and so it should be in SJS rather than MHO. In fact, it
> almost seems strange to me that observables have a special "observe"
> function which seems to do essentially the same thing as
> "sequence/transform", except it accepts multiple observables.

Yes, I understand that it might seem a little odd. The thing is,
`observe` actually does a few more things than `transform`: When one
of the input streams emits a new value while the transform function is
busy, then the current pending execution will be aborted and the
transform function will be called with the new value.

The idea here is that for streams with 'observable' semantics, the
downstream receiver will not be interested in receiving *every* value,
but the most recent value.

The sequence primitives can be a bit hard to wrap your head around,
because they can be applied to (at least) three types of constructs:
'arrays' or 'array-like' sequences, observable streams, and event
streams. All of these are pretty much the same thing (which is why we
can have primitives which work with all of them) - they are only
differentiated by the semantics expected of them.
We need to do a much better job of explaining the differences, but I
think our docs are slowly getting better :-)
Reply all
Reply to author
Forward
0 new messages