Comments (7)
Yes, that is possible. To decide if this is something that we should do it would be useful to understand the costs and benefits of such a decision.
from streamz.
I guess my current issue is that we are optimizing the execution graph based off of sinks, but some of the other nodes may do things that effect the system overall but are not sinks. Eg a map which saves something to a database or writes out some file. Currently that node would be removed if it isn't attached to a sink.
I guess one could argue that that function should be split into two parts, the first which does computation and the second which sinks to a database but to some extent we may want to meet users where they are and encourage changes without causing breakage.
This does make some things a bit more complex as the user will need to understand the difference between strong and weak ref'ed nodes, but that may be ok as it will nudge users towards the weak ref workflow while giving them a safety release valve for the short term. It will also increase our complexity some, but maybe not in a truly awful way (I don't know what this means implementation wise yet)?
Maybe another workflow is to have a dummy sink and attach it to things that we care about?
from streamz.
Two cheap options come to mind that don't require changing the codebase.
- Replace
map
withsink
in your code - Create a
keep
function that registers your stream to a global set
_kept_streams = set()
keep = _kept_streams.add
keep(source.map(func))
from streamz.
I like option 2, thank you!
from streamz.
Great. OK to close then?
from streamz.
Out of curiosity, what is the aversion to using sink
?
from streamz.
Sink and map mean different things in SHED and I've inherited the weak ref system from streamz. In this case map dispatches between the different document types (start, event, etc.) whereas sink just passes the documents to the callable (which has to handle the heterogeneity itself).
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
- visualizing streams and changing variables during runtime HOT 5
- 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 1
- 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.