Swanand Mulay
Swanand Mulay
That's a great suggestion, but for now I think `Option` will work out better. In future, we are planning to have builder pattern for it 😃 e.g. suggested by @de-sh...
> There should be a mechanism for shutting Rumqttd down. > can you elaborate more on what the scenario of shutdown look like? And how will _shutting down_ differ from...
gotcha! so basically we want to _return_ from [`broker.start()`](https://github.com/bytebeamio/rumqtt/blob/6530b1abb510ec431a22a2ab2aa4178d1162c863/rumqttd/src/server/broker.rs#L157) right? Best way I can think of is using `console`! beacause console is spawned on same thread as start fn, if...
I wonder will it be possible to have a `broker.stop()` function? :eyes:
returning a handle for sending control messages from `start()` seems a good idea! ( though will be a breaking change in API ). The handle can act as console, but...
I think _returning_ handle might get tricky: - we can't return it from start(), as we need to keep execution going on in start() - we can have a fn...
I was experimenting with this, and I think we can't ignore the cleanup! even if we drop the handles, threads will continue their execution in background, i.e. everything will still...
> have you pushed your code somewhere? I'd love to take a look > nope :( I was just playing around locally, I can provide this though: ```rust fn main()...
I will try to push code with `select!` blocks as poc tomorrow! :smile:
here is poc - https://github.com/bytebeamio/rumqtt/compare/main...rumqttd-shutdown we return an `BrokerHandle`, which can be used to _stop_ the broker! @AlexandreCassagne