amenzhinsky / iothub

Azure IoT Hub SDK for Golang
MIT License
53 stars 57 forks source link

Support for Asynchronous handling of Direct Methods #23

Open z-br opened 4 years ago

z-br commented 4 years ago

Because of how The Direct Method handler is implemented, there is no opportunity for asynchrony without blocking concurrent or future direct method requests. Ideally, instead of :

type DirectMethodHandler func(p map[string]interface{}) (map[string]interface{}, error)

It was something like:

type DirectMethodHandler func(input map[string]interface{},completion func(map[string]interface{}, error))

Or something channel based.