Sha256: 6ab0f6f1eed7b1de35c0e2af0163b265650fd02356bf91da12e55e8232f82979

Contents?: true

Size: 958 Bytes

Versions: 55

Compression:

Stored size: 958 Bytes

Contents

module Listen
  module Event
    class Config
      def initialize(
        listener,
        event_queue,
        queue_optimizer,
        wait_for_delay,
        &block)

        @listener = listener
        @event_queue = event_queue
        @queue_optimizer = queue_optimizer
        @min_delay_between_events = wait_for_delay
        @block = block
      end

      def sleep(*args)
        Kernel.sleep(*args)
      end

      def call(*args)
        @block.call(*args) if @block
      end

      def timestamp
        Time.now.to_f
      end

      attr_reader :event_queue

      def callable?
        @block
      end

      def optimize_changes(changes)
        @queue_optimizer.smoosh_changes(changes)
      end

      attr_reader :min_delay_between_events

      def stopped?
        listener.state == :stopped
      end

      def paused?
        listener.state == :paused
      end

      private

      attr_reader :listener
    end
  end
end

Version data entries

55 entries across 48 versions & 9 rubygems

Version Path
vagrant-unbundled-2.2.10.0 vendor/bundle/ruby/2.7.0/gems/listen-3.2.1/lib/listen/event/config.rb
vagrant-unbundled-2.2.9.0 vendor/bundle/ruby/2.7.0/gems/listen-3.1.5/lib/listen/event/config.rb
vagrant-unbundled-2.2.8.0 vendor/bundle/ruby/2.7.0/gems/listen-3.1.5/lib/listen/event/config.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.6.0/gems/listen-3.1.5/lib/listen/event/config.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/listen-3.1.5/lib/listen/event/config.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.7.0/gems/listen-3.1.5/lib/listen/event/config.rb
listen-3.2.1 lib/listen/event/config.rb
vagrant-unbundled-2.2.6.2 vendor/bundle/ruby/2.6.0/gems/listen-3.1.5/lib/listen/event/config.rb
chatops-rpc-0.0.2 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/listen-3.1.5/lib/listen/event/config.rb
chatops-rpc-0.0.1 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/listen-3.1.5/lib/listen/event/config.rb
vagrant-unbundled-2.2.6.1 vendor/bundle/ruby/2.6.0/gems/listen-3.1.5/lib/listen/event/config.rb
vagrant-unbundled-2.2.6.0 vendor/bundle/ruby/2.6.0/gems/listen-3.1.5/lib/listen/event/config.rb
listen-3.2.0 lib/listen/event/config.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.5.0/gems/listen-3.1.5/lib/listen/event/config.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.6.0/gems/listen-3.1.5/lib/listen/event/config.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.6.0/gems/listen-3.1.5/lib/listen/event/config.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.5.0/gems/listen-3.1.5/lib/listen/event/config.rb
alimentos-alu0100945645-0.1.0 vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/event/config.rb
alimentos-alu0100945645-1.0.0 vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/event/config.rb
vagrant-unbundled-2.2.3.0 vendor/bundle/ruby/2.5.0/gems/listen-3.1.5/lib/listen/event/config.rb