You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've never used it but according to this phrase "This producer has an internal polling thread and as such it doesn't need to be polled. It can be cheaply cloned to get a reference to the same underlying producer. The internal polling thread will be terminated when the FutureProducer goes out of scope."
You can construct the producer at the start of your app and clone the producer and pass it to actix-web as App::data or App::app_data. Then you would have access to it in middleware and handler functions.
Yes I am trying to something like that but FutureProducer required tokio runtime and currently, I am using actix_rt, I have tried actix/actix-web#1283 (comment) that solution, but then I am getting tokio issue like actix-web internally using a different version then that snippet so it's not compiling
I am not that much experienced with actix-web or rust
but then I am getting tokio issue like actix-web internally using a different version then that snippet so it's not compiling
actix-web uses tokio runtime. You can run any crates support tokio directly as long as it uses the same version of tokio as actix-web.(which currently is 0.2 and it's compat with the latest release rdkafka on crates.io)
Thank you very much for this amazing library :)
I tried a lot of places but can't find a single working example of actix-web and Kafka ( i mostly interested in https://docs.rs/rdkafka/0.24.0/rdkafka/producer/future_producer/struct.FutureProducer.html so heavy tasks can be delegated to individual consumers like Sending an email or generating thumbnail etc..)
The text was updated successfully, but these errors were encountered: