faststream
faststream copied to clipboard
Feature: Simple in-process broker
Describe the solution you'd like It would be nice to have the option to use a simple (non-thread-safe) local broker, and/or a IPC-backed broker. This would be similar to:
- TaskIQ's
InMemoryBroker - ZeroMQ's IPC Socket (this is the only thread-safe option that does not rely on an external server)
- fastapi-events
Feature code example
InMemoryBroker:
from faststream import FastStream, Logger
from faststream.nats import InMemoryBroker
broker = InMemoryBroker()
app = FastStream(broker)
# ... pub/sub works the same but is not thread-safe
...
IPCBroker:
from faststream import FastStream, Logger
from faststream.nats import IPCBroker
broker = IPCBroker()
app = FastStream(broker)
# ... pub/sub works the same
...
Describe alternatives you've considered The libraries listed above as examples, or my own wrapper over IPC sockets or ZMQ.
I'm looking for a way to run the taskiq scheduler worker.app:scheduler scheduler in process. Is this currently prossible? Such that on startup of faststream it also starts the scheduler
I would like to work on this