aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/lib/action_cable/server
Commit message (Collapse)AuthorAgeFilesLines
* Periodic timers: delegate async instance_exec to the worker poolJeremy Daer2016-06-291-4/+8
|
* Properly support reloading for Action Cable channelsMatthew Draper2016-06-022-22/+4
|
* Pass over Action Cable docsJon Moss2016-05-211-3/+3
| | | | [ci skip]
* Cable: Extract stream handler constructionJeremy Daer2016-04-181-8/+10
| | | | | | | | * 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.
* Cable: Periodic timers refreshJeremy Daer2016-04-181-12/+0
| | | | | | | | | * 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
* Cable message encodingJeremy Daer2016-03-311-9/+10
| | | | | | | | | | | | | | | | | | | * 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.
* Support faye-websocket + EventMachine as an optionMatthew Draper2016-03-023-9/+25
|
* Use AS::Executor / AS::Reloader to support reloading in ActionCableMatthew Draper2016-03-023-22/+39
|
* Merge pull request #23811 from iamvery/string-channelDavid Heinemeier Hansson2016-02-281-1/+1
|\ | | | | 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.
* | Enable Action Cable routes by defaultJon Moss2016-02-241-1/+1
|/ | | | This also marks Action Cable routes as internal to Rails.
* Full Action Cable documentation read throughJon Moss2016-02-176-21/+19
| | | | | | | | | 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]
* Merge pull request #23505 from kaspth/inject-rails-config-through-railtieKasper Timm Hansen2016-02-141-11/+4
|\ | | | | Inject Rails related configuration through Railtie
| * Default connection class to ActionCable::Connection::Base.Kasper Timm Hansen2016-02-141-2/+2
| | | | | | | | | | | | | | 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-141-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-131-1/+1
|/
* [ci skip] Several ActionCable documentation updates:Nick Quaranto2016-02-021-11/+11
| | | | | | | | * Properly indent code sample in ActionCable::Channel::Streams * Add a doc comment for #stop_all_streams * Reformat + add <tt> blocks around code references in ActionCable::Base docs * Clarify and a little better grammar on ActionCable::RemoteConnections * Correct indentation and clean up ActionCable::Server::Broadcasting code sample
* Synchronize the lazy setters in ServerMatthew Draper2016-01-301-7/+16
| | | | They're all at risk of races on the first requests.
* Revert "Revert "Eliminate the EventMachine dependency""Matthew Draper2016-01-302-5/+7
|
* Revert "Eliminate the EventMachine dependency"David Heinemeier Hansson2016-01-272-7/+5
|
* Merge pull request #23185 from droptheplot/actioncable-custom-channelsKasper Timm Hansen2016-01-241-3/+5
|\ | | | | ActionCable: Allow adding custom paths for channels
| * Rename channels_path var and fix channel_paths method for ActionCable configSergey Novikov2016-01-231-5/+5
| |
| * Allow adding custom paths for action_cable channelsSergey Novikov2016-01-221-2/+4
| |
* | Import the relevant portions of faye-websocketMatthew Draper2016-01-241-0/+4
| | | | | | | | (as adapted to use concurrent-ruby / nio4r instead of eventmachine)
* | Using a hacked faye-websocket, drop EventMachineMatthew Draper2016-01-241-5/+3
|/
* Merge pull request #22950 from maclover7/adapterize-storage-actioncableMatthew Draper2016-01-203-26/+24
|\ | | | | | | Adapterize storage for ActionCable
| * Fix code review commentsJon Moss2016-01-183-8/+17
| | | | | | | | | | | | | | - 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
| * Small PostgreSQL adapter refactors / cleanupJon Moss2016-01-181-1/+0
| | | | | | | | | | - Escape the channel name when subscribing in PG - Refactor popping the queue to make it easier to read
| * ActionCable::StorageAdapter ==> ActionCable::SubscriptionAdapterJon Moss2016-01-182-4/+6
| |
| * config_opts => cable, per @kaspthJon Moss2016-01-181-2/+2
| |
| * Tests passing and small refactoringJon Moss2016-01-181-1/+1
| |
| * Pull the action methods directly onto the adapterMatthew Draper2016-01-182-4/+3
| |
| * Refactor storage_adapterJon Moss2016-01-181-11/+3
| |
| * Adapterize ActionCable storage and extract behaviorJon Moss2016-01-183-25/+22
|/
* Fix the updated API (this sorts the concurrent-ruby switch with Basecamp)David Heinemeier Hansson2016-01-161-1/+1
|
* Revert "Merge pull request #22977 from rails/revert-22934-master"David Heinemeier Hansson2016-01-162-16/+42
| | | | | This reverts commit d0393fccffc118a5de37654aa222774b66123393, reversing changes made to 3b7ccadfc1c8dfec61af898167e1300b17f5cf25.
* Revert "Move async execution from celluloid to concurrent-ruby"David Heinemeier Hansson2016-01-082-42/+16
|
* don't need explicit dep and a pretty neat pickMike Perham2016-01-051-1/+1
|
* Use Module#thread_mattr_accessorMike Perham2016-01-051-8/+6
|
* Move async execution from celluloid to concurrent-rubyMike Perham2016-01-052-16/+44
| | | | | | | | | | | | | | This removes 8 runtime gem dependencies from Rails: ``` Using hitimes 1.2.3 Using timers 4.1.1 Using celluloid-essentials 0.20.5 Using celluloid-extras 0.20.5 Using celluloid-fsm 0.20.5 Using celluloid-pool 0.20.5 Using celluloid-supervision 0.20.5 Using celluloid 0.17.2 ```
* [ci skip] Fix grammarAkshay Vishnoi2015-12-182-2/+2
|
* Don't log Action Cable to STDOUT in developmenteileencodes2015-12-171-8/+0
| | | | | | | | | | | | | | | | | | | | Logging Action Cable to STDOUT caused the development log to see double messages like this: ``` Started GET "/" for ::1 at 2015-12-17 15:21:34 -0500 Started GET "/" for ::1 at 2015-12-17 15:21:34 -0500 Processing by Rails::WelcomeController#index as HTML Processing by Rails::WelcomeController#index as HTML Rendered /welcome/index.html.erb (0.0ms) Rendered /welcome/index.html.erb (0.0ms) Completed 200 OK in 3ms (Views: 1.3ms | ActiveRecord: 0.0ms) Completed 200 OK in 3ms (Views: 1.3ms | ActiveRecord: 0.0ms) ``` Now that Action Cable is part of Rails it doesn't need it's own logger and will log to STDOUT via the local dev server here: https://github.com/rails/rails/blob/master/railties/lib/rails/commands/server.rb
* Cargo cult fix to make Celluloid behaveDavid Heinemeier Hansson2015-12-161-0/+3
|
* Move the require to the right placeRafael Mendonça França2015-12-151-2/+0
|
* Remove the default loggerRafael Mendonça França2015-12-151-1/+0
| | | | It should be configured through the railtie
* Configure the Action Cable's redis in the engineRafael Mendonça França2015-12-151-22/+1
| | | | This will decouple Action Cable from Rails.
* Get ready to merge into RailsDavid Heinemeier Hansson2015-12-146-0/+296