         events.emit "success"
 
   end: -> 
+    @ending = true
     clearTimeout @timeoutMonitor
     @transport.end("#{@name}.queue", !@isTransportShared)
 

                events.emit("success") if returned == expiredMessages.length
              _events.on "error", (err) -> events.emit "error", err
        go => 
          @timeoutMonitor = setTimeout(loopToMonitor, @timeoutMonitorFrequency)

    @timeoutMonitor = setTimeout(loopToMonitor, @timeoutMonitorFrequency)



  constructor: (options) ->
    super

    @ending = false

    {@name, @timeoutMonitorFrequency, @transport} = options

    unless @name?
