Azure / azure-functions-host

The host/runtime that powers Azure Functions
https://functions.azure.com
MIT License
1.92k stars 441 forks source link

IAsyncCollector capability per binding type is undocumented #1945

Open Shrulik opened 7 years ago

Shrulik commented 7 years ago

The IAsyncCollector implementations/capabillities per binding type are undocumented. I think this should be fixed. Below is my private story that deals with the ServiceBus binding and its surprisingly lacking IAsyncCollector implementation.

If I understand the code correctly after exploring the issue, the binding result/implemetation of IAsyncCollector for a ServiceBus binding is MessageSenderAsyncCollector. This class has an empty implementation for IAsyncCollector#FlushAsync, where it returns a task with an immediately available result.

This means or at least implies that there is no support for batching of messages sent to a service bus. In fact, if the programmer doesn't explicitly await the result of the Task returned from AddAsync in his own code, it is possible the message will never be sent.

It is true, that the interface allows and sort of documents the possibility, but without exploring the code of the WebJobs SDK, there is no way for me know what is the status of the support for IAsyncCollector for each binding type.

MikeStall commented 7 years ago

The BYOB binding graph support should help with this. We need to find some way to expose this and make it more discoverable.