I think @rgarcia was more talking about naming here, rather than the logic: this will never get a new job (we just set `shutdown` so it will always wither be a no-op, if work is in progress, or call `shutdown`).

You could instead make these functions look something like this, which is a bit clearer:

```coffee
deregister: (cb) =>
  @shutdown = ->
    async.whilst(
      => @socket.bufferSize > 0
      (cb) -> setTimeout cb, 1000
      cb
    )
  @shutdown() unless @work_in_progress
get_next_job: =>
  return if @work_in_progress
  @shutdown?() or @sendCommand 'GRAB_JOB'
```