def has_workers?
      @mutex.synchronize do
        return false if @closed

        if @pid != Process.pid && @workers.list.empty?
          @pid = Process.pid
          spawn_workers
        end

        !@closed && @workers.list.any?
      end
    end
def has_workers?
      @mutex.synchronize do
        return false if @closed

        if @pid != Process.pid && @workers.list.empty?
          @pid = Process.pid
          spawn_workers
        end

        !@closed && @workers.list.any?
      end
    end
Checks if an active sender has any workers. A sender doesn't have any
 workers only in two cases: when it was closed or when all workers
 crashed. An *active* sender doesn't have any workers only when something
 went wrong.

 Workers are expected to crash when you +fork+ the process the workers are
 living in. In this case we detect a +fork+ and try to revive them here.

 Another possible scenario that crashes workers is when you close the
 instance on +at_exit+, but some other +at_exit+ hook prevents the process
 from exiting.

 @return [Boolean] true if an instance wasn't closed, but has no workers
 @see https://goo.gl/oydz8h Example of at_exit that prevents exit