Crates.io | brod |
lib.rs | brod |
version | 0.1.3 |
source | src |
created_at | 2023-05-04 09:18:44.324433 |
updated_at | 2023-05-04 10:18:48.192082 |
description | A wrapper library providing an API for executing Kafka producers in parallel. |
homepage | https://github.com/suarvid/Brod |
repository | https://github.com/suarvid/Brod |
max_upload_size | |
id | 856489 |
size | 63,758 |
A small wrapper library which provides functionality for executing multiple Kafka producers in parallel. The underlying Kafka functionality is provided by the rust-rdkafka library. Furthermore, in order to support the use of asynchronous FutureProducers, the tokio runtime is used.
(Named after Max Brod, a close friend of Franz Kafka, who saved Kafka's literary work.)
If Cargo, the Rust package manager, is installed, local documentation can be generated
by executing the command cargo docs --open
, which will build the documentation
and open them in the system's default web browser.
This library enables developers to write regular, sequential worker functions utilizing Kafka producers to send messages, and have these function execute in parallel, using the functionality provided by the library.
Both the synchronous BaseProducer and the asynchronous FutureProducer can be used, with the corresponding functionality provided by separate modules, sync_prod and async_prod, respectively.
The intended use case of the library is that one writes a function which utilizes a Kafka producer to send some messages, optionally carrying out some computational work in order to generate such messages. This function is then passed as a function pointer to one of the functions provided by the library which have functionality for executing the passed worker function in parallel.
It should be noted that in order to be as generic as possible, and in order to provide functionality which is as flexible as possible, the library utilizies the mechanics of type erasure provided by Rust. As such, some additional type-checking related work falls to the developer. Furthermore, the developer must also ensure that the worker functions passed to the library are fit to be executed in parallel. For most large-volume data processing use-cases, which are arguably the most likely to benefit from the library, this should be fairly simple to ensure.
For detailed information, see the examples.
Currently, the library only provides the core functionality required to enable parallel execution of worker functions in a flexible manner, along with a limited amount of utility functions. As such, there are some possible improvement areas to increase the quality of life for developers using the library. Some of these are listed below.