Skip to content

Conversation

@SeanFeldman
Copy link
Contributor

Closes #82

With this change, messages can be sent/published outside of the message handler, similar to what can be done with IEndpointInstance or IMessageSession. This enables scenarios such as dispatching messages from Timer and HTTP triggers, using both the static and FunctionsHostBuilder approach.

Using FunctionsHostBuilder approach with HttpTrigger:
image

Dispatching a message on TimerTrigger-ed Function:
image

@SeanFeldman SeanFeldman requested a review from boblangley January 7, 2021 23:54
@SeanFeldman SeanFeldman self-assigned this Jan 7, 2021
@SeanFeldman SeanFeldman force-pushed the imessagesession-support branch from 27596dc to 065f471 Compare January 8, 2021 00:36
@boblangley
Copy link
Member

Should IFunctionEndpoint now also extend IMessageSession ?

@SeanFeldman
Copy link
Contributor Author

Should IFunctionEndpoint now also extend IMessageSession ?

That's how I initially started, with extending IFunctionEndpoint with IMessageSession.
The downside of that approach was that IMessageSession is not designed for Functions runtime and ExecutionContext and ILogger are not part of the signature. Therefore Send and Publish w/o those two would be possible but not desirable. I'm also not convinced that having IMessageSession would add much value as DI would provide IFunctionsEndpoint. And it's consistent across the Functions implementation with a smaller public API surface.

For these reasons, I think trying to introduce IMessageSession is not needed.

@SeanFeldman SeanFeldman force-pushed the imessagesession-support branch from 065f471 to c4f1596 Compare January 8, 2021 05:27
@SeanFeldman SeanFeldman force-pushed the imessagesession-support branch from c4f1596 to 12cf776 Compare January 8, 2021 06:37
@SeanFeldman SeanFeldman force-pushed the imessagesession-support branch from 12cf776 to ae88465 Compare January 8, 2021 06:42
@SeanFeldman SeanFeldman merged commit 125042f into master Jan 8, 2021
@SeanFeldman SeanFeldman deleted the imessagesession-support branch January 8, 2021 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Send messages outside of a handler

3 participants