fsprojects / AzureStorageTypeProvider

An F# Azure Type Provider which can be used to explore Blob, Table and Queue Azure Storage assets and easily apply CRUD operations on them.
http://fsprojects.github.io/AzureStorageTypeProvider/
The Unlicense
84 stars 34 forks source link

Add visibilityTimeout to ProvidedQueue.Dequeue #79

Closed WilliamOckham closed 8 years ago

WilliamOckham commented 8 years ago

I am prototyping an F# application that will be using Azure Storage Queues and have found that this type provider has the most convenient API. It is missing one feature that I can't do without and I think would be useful to others. I need to set the visibilityTimeout parameter for the call to GetMessageAsync that is wrapped by ProvidedQueue.Dequeue.

The most common case for setting this parameter is when the queue message represents more than 30 seconds of work (the default visibilityTimeout) for a queue reader and you want to scale your system with multiple readers. It's important for the message to be invisible long enough for the reader to finish the work.

To address this, I changed the signature of the method to Dequeue(?connectionString, ?visibilityTimeout) and changed the call to GetMessageAsync() to use the visibilityTimeout if you pass one in. If you think this would be generally useful, I'd be happy to submit a PR.

isaacabraham commented 8 years ago

Hey. Yes, that sounds like a great idea - I should have thought of that myself! PR would be most welcome.