Skip to content

Instantly share code, notes, and snippets.

@palkan
Created November 9, 2016 11:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save palkan/42891d59f17f2cf98a074a073a0dbf35 to your computer and use it in GitHub Desktop.
Save palkan/42891d59f17f2cf98a074a073a0dbf35 to your computer and use it in GitHub Desktop.
ActionCable Streaming Patch
module ActionCable::Channel::Streams
def worker_pool_stream_handler(broadcasting, user_handler, coder: nil)
{ connection: connection, id: @identifier.to_json }
end
end
class ActionCable::SubscriptionAdapter::SubscriberMap
def invoke_callback(callback, message)
callback[:connection].send(:websocket).transmit(
"{\"identifier\": #{callback[:id]},\"message\": #{message}}"
)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment