aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* | Run Action Cable callbacks through the worker poolSean Griffin2016-04-131-2/+5
| | | | | | | | | | | | | | | | | | | | 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]
* | Generate `cable.js` file if does not exist when generating channelPrathamesh Sonpatki2016-04-122-0/+14
|/ | | | | | | | | - Before this, while generating a channel, we were not creating `cable.js` if it does not already exist. - We have similar code for application mailer here - https://github.com/rails/rails/commit/0b3ae023d27197417541932632055cd6be4810c4. - Based on the comment - https://github.com/rails/rails/issues/24418#issuecomment-205421995.
* Merge pull request #24224 from danielrhodes/actioncable-websocket-protocolsJeremy Daer2016-04-055-8/+23
|\ | | | | | | ActionCable protocol negotiation
| * Added protocol negotiationDaniel Rhodes2016-04-055-8/+23
| | | | | | | | | | | | | | | | | | This is primarily for backwards compatibility for when or if the protocol is changed in future versions. If the server fails to respond with an acceptable protocol, the client disconnects and disables the monitor.
* | Cable message encodingJeremy Daer2016-03-317-61/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | Cable: reconcile default worker pool size with low db conn pool sizeJeremy Daer2016-03-302-2/+12
| | | | | | | | | | | | | | | | | | | | | | Whack it down from 100 to 4. Large worker pools means large db connection counts. We aren't set up for that by default and most apps won't need it out of the box. We're better off tuning the default worker pool for low traffic, low resource consumption apps. Those who have higher traffic will scale up to meet demand.
* | Keep logging in the ActionCable::Channel::BaseRafael Mendonça França2016-03-302-41/+6
| | | | | | | | | | | | 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.
* | Merge pull request #23723 from mwear/action_cable_notificationsRafael Mendonça França2016-03-292-8/+56
|\ \ | | | | | | | | | Add ActiveSupport::Notification to Channel::Base#perform_action
| * | Add AS::Notifications and LogSubscriber to ActionCable::ChannelMatthew Wear2016-03-042-8/+56
| | | | | | | | | | | | | | | This commit adds ActiveSupport::Notifications instrumentation hooks and a LogSuscriber to ActionCable::Channel::Base.
* | | Cable: fix Faye periodic timer shutdown typoJeremy Daer2016-03-241-1/+1
| | |
* | | Gracefully handle disconnected clientsJeremy Daer2016-03-203-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Evented Redis adapter: log reconnect failures as errors, not just infoJeremy Daer2016-03-171-1/+1
| |/ |/| | | | | [ci skip]
* | Remove redundant regexp escapes in generatorsGadzhi Gadzhiev2016-03-081-1/+1
|/
* Share default mount path with client side .jsJavan Makhmali2016-03-032-2/+3
|
* Merge pull request #23992 from matthewd/em-optionMatthew Draper2016-03-0416-34/+154
|\ | | | | Support faye-websocket + EventMachine as an option
| * Support faye-websocket + EventMachine as an optionMatthew Draper2016-03-0216-34/+154
| |
* | Accept JSON with no backslashes/escapingJon Moss2016-03-021-6/+19
| | | | | | | | | | | | | | Fixes #22675 Allow channel identifiers and also data with no backslahes/escaping to be accepted by the subscription storer.
* | Merge pull request #23976 from danielrhodes/enhancement/ac-ping-to-message-typeMatthew Draper2016-03-022-8/+7
|\ \ | | | | | | | | | ActionCable: Add a "welcome" and "ping" message type
| * | Make ping into a message typeDaniel Rhodes2016-03-012-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | This change makes ping into a message type, which makes the whole protocol a lot more consistent. Also fixes hacks on the client side to make this all work.
| * | Added welcome message type and fix test hacksDaniel Rhodes2016-03-012-4/+5
| | |
* | | Merge pull request #23935 from y-yagi/convert_cable_coffee_to_javascriptRafael França2016-03-011-1/+1
|\ \ \ | |_|/ |/| | convert cable.coffee to cable.js
| * | convert cable.coffee to cable.jsyuuji.yaginuma2016-02-281-1/+1
| | | | | | | | | | | | In order to eliminate the dependecy of CoffeeScript.
* | | Use AS::Executor / AS::Reloader to support reloading in ActionCableMatthew Draper2016-03-025-24/+67
| |/ |/|
* | Merge pull request #23811 from iamvery/string-channelDavid Heinemeier Hansson2016-02-282-1/+2
|\ \ | |/ |/| Ensure actioncable behaves as expected with non-string queues
| * Ensure server broadcasts are to string queue namesJay Hayes2016-02-241-1/+1
| | | | | | | | | | | | Similar to the channel streaming side, these values must be strings for ActionCable to behave as expected. The conversion will allow users to send string-convertible values and get the expected behavior.
| * Convert stream broadcasting to a stringJay Hayes2016-02-241-0/+1
| | | | | | | | | | | | | | 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.
* | Add small Action Cable documentation fixesHayley Anderson2016-02-273-8/+8
| | | | | | | | | | * Fix typos/grammar errors * Make capitalization/naming consistent
* | Merge pull request #23916 from ↵Jeremy Daer2016-02-261-2/+6
|\ \ | | | | | | | | | | | | lifo/same-redis-connection-for-subscription-and-broadcast Always use redis_connector to create redis connections
| * | Use redis_connector to create redis connections for both subscriptions and ↵Pratik Naik2016-02-261-2/+6
| | | | | | | | | | | | broadcasts
* | | The async.callback call should live with the hijackMatthew Draper2016-02-261-4/+5
| | | | | | | | | | | | If we're deferring one, we should defer the other too.
* | | Merge pull request #23843 from maclover7/fix-23471Matthew Draper2016-02-252-10/+9
|\ \ \ | | | | | | | | Only hijack Rack socket when first needed
| * | | Only hijack Rack socket when first neededJon Moss2016-02-242-10/+9
| | |/ | |/| | | | | | | Fixes #23471
* / | Enable Action Cable routes by defaultJon Moss2016-02-243-4/+26
|/ / | | | | | | This also marks Action Cable routes as internal to Rails.
* | Prep release for Rails 5 beta3eileencodes2016-02-241-1/+1
| |
* | Merge pull request #23813 from lifo/faye-websocketDavid Heinemeier Hansson2016-02-231-1/+8
|\ \ | | | | | | Improve Action Cable reconnection reliability
| * | Confirm connection monitor subscription on openPratik Naik2016-02-231-1/+8
| |/
* | Merge pull request #23668 from maclover7/cable-docsRafael França2016-02-2215-58/+55
|\ \ | | | | | | Full Action Cable documentation read through
| * | Full Action Cable documentation read throughJon Moss2016-02-1715-58/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | This PR checks all active Action Cable documentation for typos and other fixes. It aims to make sure that when Rails 5 is released, that the Action Cable docs are up to snuff with the other documentation included with Rails. [ci skip]
* | | Add notes for future selvesJon Moss2016-02-221-0/+1
| | | | | | | | | | | | | | | | | | | | | Once RubyGems 2.5.0 is required, then the duplicated files can be removed, and symlinks can be used instead. [ci skip]
* | | Generate ApplicationCable files if they do not already existJon Moss2016-02-223-0/+26
| |/ |/|
* | Fixed typoChashmeet Singh2016-02-211-1/+1
| |
* | Merge pull request #23709 from jankeesvw/set-action-cable-logging-to-debugDavid Heinemeier Hansson2016-02-191-1/+1
|\ \ | | | | | | Make ActionCable logging less verbose in development
| * | Truncate ActionCable broadcast message to 300 charsJankees van Woezik2016-02-181-1/+1
| |/ | | | | | | | | | | When running the ActionCable server in development I get a lot of output in my logs, this commit sets a maximum length of 300 characters for a broadcast log message.
* / Fix `unsubscribed` server side behaviorJon Moss2016-02-182-6/+3
|/ | | | | | | | | | | | | Before this commit, the `unsubscribed` callbacks in Action Cable server side channels were never called. This is because when a WebSocket "goodbye" message was sent from the client, the Action Cable server didn't properly clean up after the now closed WebSocket. This means that memory could possibly skyrocket with this behavior, since part of this commit is to properly remove closed subscriptions from the global subscriptions hash. Say you have 10,000 users currently connected, and then all 10,000 disconnect -- before this patch, Action Cable would still hold onto information (and Ruby objects!) for all of these now dead connections.
* Merge pull request #23505 from kaspth/inject-rails-config-through-railtieKasper Timm Hansen2016-02-142-11/+10
|\ | | | | Inject Rails related configuration through Railtie
| * Default connection class to ActionCable::Connection::Base.Kasper Timm Hansen2016-02-142-2/+6
| | | | | | | | | | | | | | Instead of depending on ApplicationCable::Connection being defined at initialize we should inject it in the Railtie. Thus we can kill more setup in the tests too.
| * Inject Rails' channel paths in engine.Kasper Timm Hansen2016-02-142-9/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | We were explicitly referencing Rails.root in ActionCable::Server::Configuration.initialize, thereby coupling ourselves to Rails. Instead add `app/channels` to Rails' app paths and assign the existent files to `channel_paths`. Users can still append to those load paths with `<<` and `push` in `config/application.rb`. This means we can remove the custom `Dir` lookup in `channel_paths` and the Rails and root definitions in the tests.
* | Fix grammar `a` to `an` [ci skip]Ryuta Kamizono2016-02-132-2/+2
| |
* | Merge remote-tracking branch 'origin/master' into actioncable_loggingkp2016-02-1021-446/+350
|\|
| * don’t explicitly mention EventMachine [ci skip]yuuji.yaginuma2016-02-051-1/+1
| | | | | | | | Follow up to 6accef4e11b0c793e1c085536b5ed27f32b6a0c3