Skip to content

Commit

Permalink
note that jquery.ajax.queue-concurrent now comes from chartkick-remote
Browse files Browse the repository at this point in the history
  • Loading branch information
ashanbrown committed Aug 25, 2014
1 parent a5e37ab commit 58a630c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,14 @@ All series in an operation must use the same format.

## Remote Requests

By default requests for data in blocks, will be fetched remotely, unless `remote: false` is passed as an option to *chartkick_remote*. Using this methodology, it's easy to write a page that makes many, many json requests, which may swamp your server and possibly even time out if you have a global `timeout` value set for your ajax requests. @maccman's jquery.ajax.queue.coffee script provides a basic queueing transport layer for ajax requests which I've modified to provide an option to set the maximum number of requests that can be made in parallel (see https://gist.github.com/dontfidget/1ad9ab33971b64fe6fef). This is provided as part of Chartnado and you can include it in your javascript manifest like this:
By default requests for data in blocks, will be fetched remotely, unless `remote: false` is passed as an option to *chartkick_remote*. Using this methodology, it's easy to write a page that makes many, many json requests, which may swamp your server and possibly even time out if you have a global `timeout` value set for your ajax requests. @maccman's jquery.ajax.queue.coffee script provides a basic queueing transport layer for ajax requests which I've modified to provide an option to set the maximum number of requests that can be made in parallel (see https://gist.github.com/dontfidget/1ad9ab33971b64fe6fef). This is provided as an asset as part of chartkick-remote and you can include it in your javascript manifest like this:

```
//= require jquery.ajax.queue-concurrent
```

Chartnado extends chartkick to accept an *ajaxOptions* hash, which can be passed via chartkick_remote, which means you can then specify the maximum number of allowable requests globally for your page as follows:


```
chartkick_remote ajaxOptions: {queue: true, queueMaxConcurrency: 2}
```
Expand Down
2 changes: 1 addition & 1 deletion chartnado.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Gem::Specification.new do |spec|

spec.add_dependency "activesupport", '>= 3'
spec.add_dependency "chartkick", '>= 1.0'
spec.add_dependency "chartkick-remote", '>= 1.0'
spec.add_dependency "chartkick-remote", '>= 1.2'
spec.add_dependency "railties", ">= 3.1"
spec.add_development_dependency "bundler", '~> 1.3'
spec.add_development_dependency "rake", '~> 10.3'
Expand Down

0 comments on commit 58a630c

Please sign in to comment.