Confused about publish implementation
Hey there,
Thanks for making and maintaining this library. I'm confused about the publish implementation here. Exmqttc publish
Publish I think is async in nature in :emqttc. If the nature of it is async, why handle it using a GenServer.call and not GenServer.cast. I think the backpressure that call generates in the message queue for async publish here is unnecessary?
Please help me understand if I'm wrong in my approach here.
Hey, sorry for the slow response.
Given that I wrote this library ages ago I can't say for certain, but I think your reasoning regarding backpressure is correct. GenServer.casting the message might mean that the GenServer is busy doing other stuff and might be overloaded, in which case I would prefer the error being pushed out to the boundary as far as possible by blocking the operation.