Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions lib/action_cable/subscription_adapter/solid_cable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def initialize(event_loop)
@critical = Concurrent::Semaphore.new(0)

@reconnect_attempt = 0
@last_id = last_message_id

@thread = Thread.new do
Thread.current.name = "solid_cable_listener"
Expand Down Expand Up @@ -113,12 +114,7 @@ def invoke_callback(*)

private
attr_reader :event_loop, :thread
attr_writer :last_id
attr_accessor :reconnect_attempt

def last_id
@last_id ||= last_message_id
end
attr_accessor :last_id, :reconnect_attempt

def last_message_id
::SolidCable::Message.maximum(:id) || 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ def subscribe_as_queue(channel, adapter = @rx_adapter)
subscribed = Concurrent::Event.new
adapter.subscribe(channel, callback, proc { subscribed.set })
subscribed.wait(WAIT_WHEN_EXPECTING_EVENT)
sleep WAIT_WHEN_EXPECTING_EVENT
assert_predicate subscribed, :set?

yield queue
Expand Down