Skip to content

Commit

Permalink
Merge pull request #84 from WilliamOckham/master
Browse files Browse the repository at this point in the history
Master
  • Loading branch information
isaacabraham authored Jul 21, 2016
2 parents da7bc5b + 895ec3f commit abe2da0
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/FSharp.Azure.StorageTypeProvider/Queue/ProvidedQueueTypes.fs
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,26 @@ type ProvidedQueue(defaultConnectionString, name) =
if queueRef.ApproximateMessageCount.HasValue then queueRef.ApproximateMessageCount.Value
else 0

/// Dequeues the next message.
member __.Dequeue(?connectionString) =
/// Dequeues the next message and optionally sets the visibilityTimeout (i.e. how long you can work with the message before it reappears in the queue)
member __.Dequeue(?connectionString, ?visibilityTimeout) =
async {
let! message = (getQueue connectionString).GetMessageAsync() |> Async.AwaitTask
let! message = (getQueue connectionString).GetMessageAsync(visibilityTimeout |> Option.toNullable, null, null) |> Async.AwaitTask
return
match message with
| null -> None
| _ -> Some(message |> Factory.toProvidedQueueMessage)
}


/// Dequeues the next message using the default connection string and sets the visibilityTimeout (i.e. how long you can work with the message before it reappears in the queue)
member __.Dequeue(visibilityTimeout) =
async {
let! message = (getQueueRef name defaultConnectionString).GetMessageAsync(visibilityTimeout |> Nullable , null, null) |> Async.AwaitTask
return
match message with
| null -> None
| _ -> Some(message |> Factory.toProvidedQueueMessage)
}

/// Generates a full-access shared access signature, defaulting to start from now.
member __.GenerateSharedAccessSignature(duration, ?start, ?connectionString) =
getQueue connectionString |> generateSas start duration
Expand Down

0 comments on commit abe2da0

Please sign in to comment.