Sha256: fd1e5e69ebe835541bbd018c31ed3b79d4833d0fa88345cf484bea447396e402

Contents?: true

Size: 330 Bytes

Versions: 4

Compression:

Stored size: 330 Bytes

Contents

# frozen_string_literal: true

require_relative '../../polyphony'

module Polyphony
  # Implements a unidirectional communication channel along the lines of Go
  # (buffered) channels.
  class Channel < Polyphony::Queue
    alias_method :receive, :shift

    def close
      flush_waiters(Polyphony::MoveOn.new)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
polyphony-0.99 lib/polyphony/core/channel.rb
polyphony-0.98 lib/polyphony/core/channel.rb
polyphony-0.97 lib/polyphony/core/channel.rb
polyphony-0.96 lib/polyphony/core/channel.rb