amenzhinsky / iothub

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

Possible change to direct methods #28

Open bocajim opened 3 years ago

bocajim commented 3 years ago

Does anyone have any inputs/objections to an alternate direct method implementation that can change the reply to be asynchronous from the callback? I have a use case where I need processing time to handle the callback and I don't want to hold the context, I want to send the reply at a later date.

Possible changes:

  1. Callback provides messageID and then a new function is added that sends a reply when that is invoked
  2. Callback provides a struct with a Reply() method for easy responses (but harder serialization to manage).

I prefer #1 because it is easy to pass the ID between async processing.