Comments (5)
The instances of streamz are pretty simple things, and you can mutate them in place freely during runtime.
To dynamically attach and detach nodes, you want the .connect()
and .disconnect
methods, called on the upstream node. Events emitted while disconnected will then be dropped.
Similarly, you can mutate any attribute of a streams node instance. Some nodes, like aggregate
have explicit .state
attributes that hold the "current" value, and you can set them to whatever you would like. For the filter
node, the attribute is called .predicate
and, again, you can reassign it at will. A little investigation of the source of any node you want to change will tell you what the attributes are and what type should be assigned to them.
Note that some sources also have explicit .start()
/.stop()
methods, because they poll some external provider of events, and these methods allow you to pause that polling.
from streamz.
Oh, and for visualising, I don't think there's any tool that will redraw the event graph itself upon changes such as I've described. Probably holoviz tools could be made to do it with a little hackery. Since the main network viz option for streamz is graphviz, it is restricted to static output (but you could call it multiple times, whenever).
from streamz.
Thank you @martindurant that is helpful. I think I need to learn some techniques to introspect the entire streamz graph from a separate thread that runs my visualization. maybe I can branch every operator and mirror the metadata and events into this new visualization thread, display the events and operator status. and also create a feedback stream into each operator object that calls a function '_update_operator'. _update_operator would then mutate the stream. Another way of putting could be, every stream operator has an upstream that it watches for management events, if it receives a management event it calls _update_operator and mutates self.
from streamz.
The more I think about this, the streams that mirror data and state out to the management thread/system should not be upstreams in the existing sense of the term, I'll probably look at introducing a dedicated management stream and management feedback stream. these management streams will only interact from the management thread to the stream operators.
from streamz.
Please do let us know what you end up implementing. I'm not convinced that you need a separate thread to do what you are suggesting - there is no reason two disconnected event graphs can't be run by the same event loop. However, if they are listening for very different kinds of events (e.g., user actions versus socket or timing signals) than you might be right.
from streamz.
Related Issues (20)
- missing positional argument: 'topic' in to_mqtt HOT 5
- How to parametrize stream/pipeline creation? HOT 2
- Passing Username and Password to from_mqtt() HOT 4
- Dynamically add upstreams to zip HOT 2
- Dropping `pkg_resources`
- AttributeError: 'Output' object has no attribute '_ipython_display_' HOT 3
- flatten doesn't work with iterables without defined length HOT 2
- Is it possible to use event time/syntethic time rather than system time? HOT 2
- Time based lookback window? HOT 1
- Streamz not working in Jupyterlite
- Collect does not allow awaitable sinks
- Quickstart lacks conda/environments/streamz_dev.yml HOT 6
- Hello from LorryStream and Kotori / Streamz is cool HOT 2
- Add pytest fixture to clean up the IO loop HOT 4
- Streamz hvplot resets zoom and pan on each update HOT 3
- streamz's typing system can't work properly in vscode HOT 2
- Streamz with websocket not steaming any data HOT 5
- Parallel streams with buffers HOT 3
- Is streamz not maintained anymore? What happened to cuStreamz? HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from streamz.