Sha256: 50a1cecc27ab8bc7a34e7bd69590707c07e751dd5b124d441ec4a267bafccb90

Contents?: true

Size: 634 Bytes

Versions: 4

Compression:

Stored size: 634 Bytes

Contents

module Sidekiq
  module Actor

    module ClassMethods
      def trap_exit(*args)
      end
      def new_link(*args)
        new(*args)
      end
    end

    module InstanceMethods
      def current_actor
        self
      end
      def after(interval)
      end
      def alive?
        !@dead
      end
      def terminate
        @dead = true
      end
      def defer
        yield
      end
    end

    def self.included(klass)
      if $TESTING
        klass.__send__(:include, InstanceMethods)
        klass.__send__(:extend, ClassMethods)
      else
        klass.__send__(:include, Celluloid)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sidekiq-2.17.8 lib/sidekiq/actor.rb
sidekiq-2.17.7 lib/sidekiq/actor.rb
sidekiq-2.17.6 lib/sidekiq/actor.rb
sidekiq-2.17.5 lib/sidekiq/actor.rb