lib/ably/realtime/channel.rb in ably-0.1.2 vs lib/ably/realtime/channel.rb in ably-0.1.3
- old
+ new
@@ -1,8 +1,9 @@
module Ably
module Realtime
class Channel
+ include Ably::Modules::Conversions
include Callbacks
STATES = {
initialised: 1,
attaching: 2,
@@ -50,10 +51,10 @@
check_state = STATES.fetch(check_state) if check_state.kind_of?(Symbol)
@state == check_state
end
def publish(event, data)
- queue << { name: event, data: data, timestamp: Time.now.to_i * 1000 }
+ queue << { name: event, data: data, timestamp: as_since_epoch(Time.now) }
if attached?
process_queue
else
attach