Git Product home page Git Product logo

Comments (10)

mrocklin avatar mrocklin commented on September 4, 2024 2

Maybe @CJ-Wright or @jrmlhermitte has time here?

from streamz.

snth avatar snth commented on September 4, 2024 1

Sure, if I can get it to work I'll submit an example.

from streamz.

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

I don't have a ton of experience with async programming, but I can try look at an example.

from streamz.

mrocklin avatar mrocklin commented on September 4, 2024

Do you need something in a separate thread or can your entire application be asynchronous? Presumably if you are already using asyncio then you should be somewhat comfortable with running asynchronous applications. You could consider moving to the Tornado event loop, which should also support asyncio applications.

from streamz.

snth avatar snth commented on September 4, 2024

I'm not sure. I'm listening to various websockets and they're all emitting events and awaiting each other. Everything works great except if I add a .timed_window() to any stream then that stream locks up. I'm not sure what the problem is.

from streamz.

snth avatar snth commented on September 4, 2024

My code is in the github.com/snth/numismatic package.

In particular in https://github.com/snth/numismatic/blob/master/numismatic/exchanges.py on line 47 I would like to replace the .partition(...) with .timed_window(interval=batch_size).

from streamz.

mrocklin avatar mrocklin commented on September 4, 2024

It looks like you already have an event loop running with asyncio. Here are the docs on using Asyncio event loops with tornado: http://www.tornadoweb.org/en/stable/asyncio.html

You can provide the timed_window constructor with a loop= keyword to give it the right event loop.

I agree with you that an example on how to use streamz with an asyncio application would be very valuable. If I get some time I'll write something up but unfortunately I can't guarantee that this will happen in the very near future. If you have the time I strongly encourage you to write up a small example and submit it. I think that others like yourself might also find it valuable.

from streamz.

jrmlhermitte avatar jrmlhermitte commented on September 4, 2024

Same but interested. I think it's a great opportunity start more discussion on this now. (Thanks for the ping @mrocklin )

from streamz.

snth avatar snth commented on September 4, 2024

I've created an example. Please see if it works for you too.

from streamz.

mrocklin avatar mrocklin commented on September 4, 2024

This was great. Closing

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.