1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

25 commits

Author SHA1 Message Date
Jeremy Daer
3ba0eec20c
Cable: Extract stream handler construction
* Use separate stream handler builders for easy override and testing.
* Fix worker pool execution that was silently failing since it only
  expected connection receivers.

Sparked by code in #24162.
2016-04-18 23:29:51 -07:00
Jeremy Daer
983b743c8c
Cable: Periodic timers refresh
* Rewrite docs
* Support blocks in addition to method names and Proc args
* Check for valid arguments
* Convert `periodically :method_name` to Proc callbacks
* Drop periodic runner methods from the worker pool
* Ensure we clear active periodic timers after shutdown
2016-04-18 13:08:22 -07:00
Sean Griffin
d1766ef53d Run Action Cable callbacks through the worker pool
Alternate implementation of #24162 with tests. The code had diverged
too far on master to pull that implemenation directly.

Fixes #23778
Close #24162

[Mattew Draper & Sean Griffin]
2016-04-13 13:09:16 -06:00
Jeremy Daer
b168eb5819 Cable message encoding
* Introduce a connection coder responsible for encoding Cable messages
  as WebSocket messages, defaulting to `ActiveSupport::JSON` and duck-
  typing to any object responding to `#encode` and `#decode`.
* Consolidate encoding responsibility to the connection. No longer
  explicitly JSON-encode from channels or other sources. Pass Cable
  messages as Hashes to `#transmit` and rely on it to encode.
* Introduce stream encoders responsible for decoding pubsub messages.
  Preserve the currently raw encoding, but make it easy to use JSON.
  Same duck type as the connection encoder.
* Revert recent data normalization/quoting (#23649) which treated
  `identifier` and `data` values as nested JSON objects rather than as
  opaque JSON-encoded strings. That dealt us an awkward hand where we'd
  decode JSON strings… or not, but always encode as JSON. Embedding
  JSON object values directly is preferably, no extra JSON encoding,
  but that should be a purposeful protocol version change rather than
  ambiguously, inadvertently supporting multiple message formats.
2016-03-31 07:08:16 -07:00
Rafael Mendonça França
edbfd10876 Keep logging in the ActionCable::Channel::Base
To move Action Cable logging to a LoggingSubscriber we need to pass the
log tags in the notification payload since Action Cable logging use the
Channel instance to tag the logs.
2016-03-30 00:03:11 -03:00
Matthew Wear
09a1321d5b Add AS::Notifications and LogSubscriber to ActionCable::Channel
This commit adds ActiveSupport::Notifications instrumentation hooks
and a LogSuscriber to ActionCable::Channel::Base.
2016-03-04 14:47:54 -08:00
Matthew Draper
a373be9da4 Support faye-websocket + EventMachine as an option 2016-03-02 12:17:15 +10:30
Jay Hayes
046e32656e Convert stream broadcasting to a string
ActionCable does some things behind the scenes that expects these
"broadcasting"s or "channel"s to be strings. However it's not
immediately obvious that the value must be a string. So adding this
conversion ensures things work as expected.
2016-02-24 12:43:23 -06:00
Jay Hayes
b426247250 whitespace 2016-02-24 12:42:55 -06:00
Matthew Draper
74497eabd5 Revert "Revert "Eliminate the EventMachine dependency"" 2016-01-30 03:46:37 +10:30
David Heinemeier Hansson
9ea7aa84d1 Revert "Eliminate the EventMachine dependency" 2016-01-27 14:33:15 +01:00
Matthew Draper
68a9060d02 Using a hacked faye-websocket, drop EventMachine 2016-01-24 22:51:06 +10:30
Jon Moss
ae31da20cd Fix code review comments
- adapter -> pubsub (re)rename internally
- Change variable names to match method names
- Add EventMachine `~> 1.0` as a runtime dependency of ActionCable
- Refactor dependency loading for adapters
2016-01-18 19:37:25 -05:00
Jon Moss
6aeaed4c1a All Redis deps are now optional, Postgres --> PostgreSQL adapter 2016-01-18 18:59:30 -05:00
Jon Moss
bc413e814b Tests passing and small refactoring 2016-01-18 18:59:01 -05:00
Akshay Vishnoi
0e5b6d5958 [ActionCable] declare asset_logged private 2015-12-19 04:14:58 +05:30
Kasper Timm Hansen
1c47f7d184 Merge pull request #22668 from ryohashimoto/151219_receive
Fix `receive` spelling
2015-12-18 17:28:31 +01:00
Ryo Hashimoto
161dc68599 Fix receive spelling 2015-12-19 01:09:16 +09:00
Rafael França
905a2a176b Merge pull request #22667 from akshay-vishnoi/base_test_case
[ActionCable] Test invalid action on channel
2015-12-18 14:07:55 -02:00
Kasper Timm Hansen
6a2c3c4c83 Fix receive spelling and add whitespace
Found `recieve` next to the correctly spelled method name, fixed it.

Also we prefer a one space padding within hashes, add that.
2015-12-18 16:53:04 +01:00
Akshay Vishnoi
46adddbfb5 [ActionCable] Test invalid action on channel 2015-12-18 21:10:06 +05:30
Akshay Vishnoi
fef41f40b6 [ActionCable] test perform action with default action 2015-12-18 20:45:43 +05:30
Akshay Vishnoi
db36507644 [ActionCable] Test available actions on Channel 2015-12-18 20:02:45 +05:30
Arun Agrawal
e1459c7c86 Remove warnings from actioncable
Warnings coming from code and test are removed
2015-12-17 16:42:34 +01:00
David Heinemeier Hansson
bf40bddfce Get ready to merge into Rails 2015-12-14 15:48:54 +01:00