anchor.diff:                      |> Async.Ignore
           }
           
  -        member x.DequeueAsync(timeout) = failwith "Not implemented yet"
  +        member __.DequeueAsync(timeout) = async {
  +            let req = ReceiveMessageRequest(QueueUrl = queueUri)
  +            req.MaxNumberOfMessages <- 1
  +            
  +            // always make use of long polling for efficiency
  +            // but never wait for more than max allowed (20 seconds)
  +            req.WaitTimeSeconds <- min maxWaitTime <| defaultArg timeout maxWaitTime
   
  -        member x.DequeueBatchAsync(maxItems) = failwith "Not implemented yet"
  +            match timeout with
  +            | Some _ ->
  +                let! res = account.SQSClient.ReceiveMessageAsync(req)
  +                           |> Async.AwaitTaskCorrect
  +                if res.Messages.Count = 1
  +                then return readBody res.Messages.[0]
  +                else return! Async.Raise(TimeoutException())
  +            | _ -> 
  +                let rec aux _ = async {
  +                    let! res = account.SQSClient.ReceiveMessageAsync(req)
  +                               |> Async.AwaitTaskCorrect
  +                    if res.Messages.Count = 1
  +                    then return readBody res.Messages.[0]
  +                    else return! aux ()
  +                }
  +                return! aux ()
  +        }
  +
  +        member __.DequeueBatchAsync(maxItems) = async {
  +            let req = ReceiveMessageRequest(QueueUrl = queueUri)
  +            req.MaxNumberOfMessages <- min maxItems maxRecvCount
  +
  +            let! res = account.SQSClient.ReceiveMessageAsync(req)
  +                       |> Async.AwaitTaskCorrect
  +            return res.Messages |> Seq.map readBody |> Seq.toArray
  +        }
           
  -        member x.TryDequeueAsync() = failwith "Not implemented yet"
  +        member __.TryDequeueAsync() = async {
  +            let req = ReceiveMessageRequest(QueueUrl = queueUri)
  +            req.MaxNumberOfMessages <- 1
  +
  +            let! res = account.SQSClient.ReceiveMessageAsync(req)
  +                       |> Async.AwaitTaskCorrect
  +            if res.Messages.Count = 1 
  +            then return Some <| readBody res.Messages.[0]
  +            else return None
  +        }
   
           member x.GetCountAsync() = failwith "Not implemented yet"
   
  
positive.code: 
      [<DataMember(Name = "QueueUri")>]
      let queueUri = queueUri
  
      let toBase64 (message : 'T) = 
          message
  
negative.code:             let groups = 
                  entries 
                  |> Seq.mapi (fun i e -> i, e)
                  |> Seq.groupBy (fun (i, _) -> i / maxBatchCount)
                  |> Seq.map (fun (_, gr) -> gr |> Seq.map snd)
          
              // TODO: partial failures are not really handled right now
  