Sha256: 9df1bf81b7ff952a3102b236beaacc078c243276d1723ec95fef9c6b5f1527e8

Contents?: true

Size: 365 Bytes

Versions: 15

Compression:

Stored size: 365 Bytes

Contents

# encoding: UTF-8

require 'simultaneous'

module Spontaneous
  module Rack
    class EventSource < ::Simultaneous::Rack::EventSource
      def push(client)
        @lock.synchronize { @clients << client }
      end

      alias_method :<<, :push

      def delete(client)
        @lock.synchronize { removed = @clients.delete(client) }
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
spontaneous-0.2.0.beta10 lib/spontaneous/rack/event_source.rb
spontaneous-0.2.0.beta9 lib/spontaneous/rack/event_source.rb
spontaneous-0.2.0.beta8 lib/spontaneous/rack/event_source.rb
spontaneous-0.2.0.beta7 lib/spontaneous/rack/event_source.rb
spontaneous-0.2.0.beta6 lib/spontaneous/rack/event_source.rb
spontaneous-0.2.0.beta5 lib/spontaneous/rack/event_source.rb
spontaneous-0.2.0.beta4 lib/spontaneous/rack/event_source.rb
spontaneous-0.2.0.beta3 lib/spontaneous/rack/event_source.rb
spontaneous-0.2.0.beta2 lib/spontaneous/rack/event_source.rb
spontaneous-0.2.0.beta1 lib/spontaneous/rack/event_source.rb
spontaneous-0.2.0.alpha7 lib/spontaneous/rack/event_source.rb
spontaneous-0.2.0.alpha6 lib/spontaneous/rack/event_source.rb
spontaneous-0.2.0.alpha5 lib/spontaneous/rack/event_source.rb
spontaneous-0.2.0.alpha4 lib/spontaneous/rack/event_source.rb
spontaneous-0.2.0.alpha3 lib/spontaneous/rack/event_source.rb