Sha256: fa25b7366bd45e496b57e98c41fe76d4194f1f8a60f4afd597331d4527890d7d

Contents?: true

Size: 404 Bytes

Versions: 7

Compression:

Stored size: 404 Bytes

Contents

module Af::QThread
  module Interface
    def has_message?
      return !queue.empty?
    end

    def read_message
      return queue.pop
    end

    def post_message(message)
      queue << message
    end

    def requeue(message)
      post_message(message)
    end

    def post_data_message(data, from = Thread.current)
      post_message(::Af::QThread::Message.new(data, from))
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fiksu-af-1.1.6 lib/fiksu-af/q_thread/interface.rb
fiksu-af-1.1.5 lib/fiksu-af/q_thread/interface.rb
fiksu-af-1.1.4 lib/fiksu-af/q_thread/interface.rb
fiksu-af-1.1.3 lib/fiksu-af/q_thread/interface.rb
fiksu-af-1.1.2 lib/fiksu-af/q_thread/interface.rb
fiksu-af-1.1.1 lib/fiksu-af/q_thread/interface.rb
fiksu-af-1.1.0 lib/fiksu-af/q_thread/interface.rb