I would probably just list all three parameters as arguments to the callback. The contract would be: if device is null, then result and error_message tells you why.
It is an interesting idea to expand mojom to express application-level exception callbacks. That has been a topic of discussion from the beginning. As you can tell, we haven't gone there .... maybe we should.
(By the way, can error_message be derived from result, or does it contain more information?)
-Darin
However, if you are careful to run callbacks prior to returning control to mojo, then you can make some ordering assumptions. Point being that there is one FIFO per interface.
We have a long standing idea to invent a way to share a FIFO across multiple interfaces. This would allow you to have a user defined "callback" interface with multiple methods, and again if you are careful, you can make some ordering assumptions.
-Darin
However, if you are careful to run callbacks prior to returning control to mojo, then you can make some ordering assumptions. Point being that there is one FIFO per interface.
We have a long standing idea to invent a way to share a FIFO across multiple interfaces. This would allow you to have a user defined "callback" interface with multiple methods, and again if you are careful, you can make some ordering assumptions.
Cool, looking forward to it!