Git Product home page Git Product logo

Comments (4)

mrocklin avatar mrocklin commented on September 4, 2024

Can I suggest that this is an extreme case of a streaming join operation. In a streaming join operation you're going to hold on to some backlog of events in each stream and when an event occurs in the others you emit if some condition is met. Full outer product is this case when the condition is lambda *args: True and the backlog is infinite.

When thinking about streaming joins there are now questions about how to define the length of a backlog. Is it a number of elements? Is it something having to do with the data itself, like a time value?

from streamz.

CJ-Wright avatar CJ-Wright commented on September 4, 2024

Hmm ok I like that vision of the problem.
As a side note we may want to look to itertools to find new nodes to implement.

Keeping track of the number of elements is ok. The timed one would mean that we would need to track at what time the data came down and then cull the data as it became to old, which may be possible. We could even ask the user to provide a pair of functions, one which assigns a value to the data and the other which asses if the value invalidates the data.

egs

source = Stream()
source2 = Stream()
timeout_node = source.conditional_product(source2, assigning_function=time, deciding function=lambda x: (time() - x) < 60)

In this case if the data is older than a minute then we remove it.

source = Stream()
source2 = Stream()
CountClass():
    def __call__():
        self.i += 1
        return self.i
countout_node = source.conditional_product(source2, assigning_function=CountClass, deciding function=lambda x: x + 5 < CountClass.i)
source = Stream()
source2 = Stream()
outer_product = source.conditional_product(source2, assigning_function=lambda *args: True, deciding function=lambda x: x, emit_on=source)

from streamz.

mrocklin avatar mrocklin commented on September 4, 2024

As a side note we may want to look to itertools to find new nodes to implement.

Sure, I'm biased, but toolz may also have operations (like streaming joins). However, I'm also inclined to only add things as they become necessary. There is a cost to adding and maintaining functionality.

Similarly for time-based joins I would say that we shouldn't deal with it until we have a reason to. Number-of-element buffers are probably more sensible to deal with.

from streamz.

CJ-Wright avatar CJ-Wright commented on September 4, 2024

That's fair.

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.