Sha256: 85f1aaa7e81d93a0316bde77f5c0bb3e88f638a61f50999ef1124f9248d2c4cb
Contents?: true
Size: 741 Bytes
Versions: 8
Compression:
Stored size: 741 Bytes
Contents
module Extface class Driver::RawSerial < Extface::RawDriver NAME = 'RAW Serial'.freeze has_serial_config def push(buffer) Extface.redis.rpush(:key, buffer) Extface.redis.subscribe(:extface) do |on| on.message do |event, data| @return = "event: #{event} data: #{data}\n\n" Extface.redis.unsubscribe end end end def receive(timeout = nil) list, element = Extface.redis.blpop(:key, :timeout => timeout) # Extface.redis.subscribe(:extface) do |on| # on.message do |event, data| # @return = "event: #{event} data: #{data}\n\n" # Extface.redis.unsubscribe # end # end return element end end end
Version data entries
8 entries across 8 versions & 1 rubygems