Comments (2)
Because you have access to asyncio
functionalities, you can achieve the same thing by creating tasks on the event loop. And then await
them until all the messages have been sent i.e. if you don't care about the order the messages are going to be sent. Here is a code example:
@app.agent(input_topic)
async def split_messages(stream):
async for event in stream:
tasks = []
for reading in event.readings:
individual_event = IndividualEvent(id=reading.id, value=reading.value)
task = asyncio.create_task(
output_topic.send(key=individual_event.id, value=individual_event)
)
tasks.append(task)
await asyncio.gather(*tasks)
from faust.
Can this issue be closed as it was answered?
from faust.
Related Issues (20)
- 3.12 test compatibility
- Using debugging mode inside a container is impossible because the console host is not parametrized
- Rebalancing problem with Faust Streaming consumer
- A race condition in recovery causes unrecoverable gaps in acked offsets and consequently blocks committing
- Cannot recover when any changelog topic partition becomes empty (as a result of some retention policy)
- `SetTable`s are missing `on_clear` HOT 1
- Rebalancing problem with Faust Streaming
- Closing connection
- Events getting skipped HOT 1
- Wrong offset commit in case of gaps
- Logic around sensor _on_stream_event_in differs between cython and python implementations
- Does Faust Streaming Consumer retry the offset commit if it fails? HOT 1
- Add a method to include the whole message when using the take method HOT 1
- ModuleNotFoundError: No module named 'mode.utils.typing' HOT 4
- 0.10.22 is broken HOT 4
- normal logging mode
- Question: Throttle Reconnect Attempts when kafka is unavailable HOT 1
- How to check liveness of agent? HOT 6
- StreamT has no filter abstract method
- Remove aredis
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 faust.