GithubHelp home page GithubHelp logo

Comments (5)

jrmlhermitte avatar jrmlhermitte commented on May 27, 2024

I think for simplicity, maybe combine_latest should just assume that you only emit on the first child, which means changing this line in combine_latest:

        if not self.missing and who == self.children[0]:

thus this will emit once:

s1 = Stream()
s2 = Stream()
sout = s1.combine_latest(s2)
sout.map(print)

s2.emit(1)
s1.emit(1)
s2.emit(1)
s1.emit(1)
s2.emit(1)
s1.emit(1)

which only prints on emitting from s1.

In the long run, I think a trigger should be added somewhere. Perhaps add a trigger flag to the buffer stream element?

What do you think? I think it's simpler than anything else I can think of. Also, we should fork streams itself (separate from event model). It could be on your or my branch, up to you.

from streamz.

mrocklin avatar mrocklin commented on May 27, 2024

from streamz.

CJ-Wright avatar CJ-Wright commented on May 27, 2024

I like the idea of a kwarg for this.

I guess it would be like:

emiting_children = [child for child, t in zip(self.children, trigger) if t is True]
if not self.missing and who in allowed_emiting:

from streamz.

jrmlhermitte avatar jrmlhermitte commented on May 27, 2024

Sorry yes, that was too restrictive. I like that too.
Maybe have the keyword be the list (or one element) of numerically ordered children as a compromise?
(so s.combine_latest(emit_on=0) would be fine)
I suggest a PR somewhere? Maybe @CJ-Wright self-PR from your feature branch to your master and we can work from there? (Unless @mrocklin you want to do it)

from streamz.

CJ-Wright avatar CJ-Wright commented on May 27, 2024

Closed by #32

from streamz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.