flextream
Flextream 🏞️
Flextream is a tool for handling streaming to eventhub with minimal bottlenecks
Utility library forstreaming to Azure Event hubs. Handles background threaded process, and connection caching to minimise bottlenecks when streaming data over hubs.
Can be pip installed with pip install flextream
.
To use, you'll mostly, just need a single function:
from flextream import send_to_event_hub
send_to_event_hub(
{"message": "hello world!", "also_some_numbers": [1, 2, 3]},
namespace="namestapce-name.servicebus.windows.net",
eventhub="my-first-eventhub",
latency=10,
)
In the above example, bespoke credentials haven't been passed into the credential
keyword, so it will fall back to authenticating with DefaultAzureCredentials
. The latency
parameter is the maximum amount of time in seconds that a message will be held onto before being sent in a background triggered thread.
Any other messages sent to the eventhub during the wait time will be bundles alongside in a batch for efficiency.
1""" 2# Flextream 🏞️ 3 4Flextream is a tool for handling streaming to eventhub with minimal bottlenecks 5 6Utility library forstreaming to Azure Event hubs. Handles background threaded process, and connection caching to minimise bottlenecks when streaming data over hubs. 7 8Can be pip installed with `pip install flextream`. 9 10To use, you'll mostly, just need a single function: 11 12```python 13from flextream import send_to_event_hub 14 15send_to_event_hub( 16 {"message": "hello world!", "also_some_numbers": [1, 2, 3]}, 17 namespace="namestapce-name.servicebus.windows.net", 18 eventhub="my-first-eventhub", 19 latency=10, 20) 21``` 22 23In the above example, bespoke credentials haven't been passed into the `credential` keyword, so it will fall back to authenticating with `DefaultAzureCredentials`. The `latency` parameter is the maximum amount of time in seconds that a message will be held onto before being sent in a background triggered thread. 24 25Any other messages sent to the eventhub during the wait time will be bundles alongside in a batch for efficiency. 26""" 27 28from flextream.batch_handler import send_to_eventhub, BatchHandler # noqa 29from flextream._version import __version__ # noqa