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

21 commits

Author SHA1 Message Date
Matthew Draper
a8df1bc345 Properly support reloading for Action Cable channels 2016-06-02 04:08:48 +09:30
Vipul A M
02a31cfdd1 - Fixed ActionCable::Connection::ClientSocketTest that was overriding ActionCable::Connection::StreamTest test name
- Only add attr_readers for required attributes
2016-04-15 16:03:21 +05:30
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
Jeremy Daer
4f8a8e2c06 Gracefully handle disconnected clients
We'll get `Errno::ECONNRESET` if the client forcibly disconnected.
Just close the socket rather than raising the exception.

Handle other errors in `ClientSocket#write`, too, mirroring the Faye
error handling which swallows all `StandardError` on write.
2016-03-20 17:36:22 -07:00
Matthew Draper
bbba0649f5 Merge pull request #23992 from matthewd/em-option
Support faye-websocket + EventMachine as an option
2016-03-04 05:31:48 +10:30
Jon Moss
45635098ac Accept JSON with no backslashes/escaping
Fixes #22675

Allow channel identifiers and also data with no backslahes/escaping to be accepted by
the subscription storer.
2016-03-02 09:01:43 -05:00
Matthew Draper
a373be9da4 Support faye-websocket + EventMachine as an option 2016-03-02 12:17:15 +10:30
Daniel Rhodes
f51cb7eef5 Added welcome message type and fix test hacks 2016-03-01 01:38:35 +01:00
Jon Moss
a536cc8f1e Only hijack Rack socket when first needed
Fixes #23471
2016-02-24 21:48:59 -05:00
Pratik Naik
426676e8d0 Confirm connection monitor subscription on open 2016-02-23 09:37:49 -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
322dca293b Import the relevant portions of faye-websocket
(as adapted to use concurrent-ruby / nio4r instead of eventmachine)
2016-01-24 22:52:40 +10:30
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
bc413e814b Tests passing and small refactoring 2016-01-18 18:59:01 -05:00
David Heinemeier Hansson
01c320001b Revert "Merge pull request #22977 from rails/revert-22934-master"
This reverts commit d0393fccff, reversing
changes made to 3b7ccadfc1.
2016-01-16 15:42:20 +01:00
David Heinemeier Hansson
36fe301564 Revert "Move async execution from celluloid to concurrent-ruby" 2016-01-08 20:09:25 +01:00
Mike Perham
2bb65e64e6 Remove celluloid references 2016-01-05 15:10:11 -08:00
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