Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5054443
Showing
13 changed files
with
215 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.DS_Store |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
!SLIDE | ||
|
||
# ¡Resque! | ||
|
||
!SLIDE center | ||
|
||
# GitHub's Background Processing Library | ||
|
||
![Octocat](octocat.png) | ||
|
||
!SLIDE bullets incremental | ||
|
||
# ¡Resque! | ||
|
||
* Redis-backed | ||
* parent / child fork model | ||
* god / monit friendly | ||
* Sinatra web UI | ||
|
||
!SLIDE bullets incremental | ||
|
||
# Why Redis? | ||
|
||
* Atomic push and pop | ||
* O(1) push and pop | ||
* High visibility | ||
* Modify existing queue in place | ||
|
||
!SLIDE bullets incremental | ||
|
||
# parent / child forking | ||
|
||
* Parent starts & loads environment | ||
* Parent grabs a job | ||
* Parent forks | ||
* Child processes job | ||
* Child exits | ||
* Repeat! | ||
|
||
!SLIDE bullets incremental | ||
|
||
# parent / child forking | ||
|
||
* Child can die, parent lives on | ||
* Parent is free to listen and respond to signals | ||
* Parent can kill unruly children | ||
* Parent can kill long running children | ||
|
||
!SLIDE bullets incremental | ||
|
||
# god / monit friendly | ||
|
||
* Parent responds promptly to signals | ||
* Can gracefully or forcefully shut down | ||
* Advertises runtime in procline | ||
* `resque: Forked 2739 at 1264118796` | ||
|
||
!SLIDE center | ||
|
||
# Sinatra web UI | ||
|
||
![web-ui](web-ui.png) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
!SLIDE bullets incremental | ||
|
||
# Queues | ||
|
||
* Supports multiple queues | ||
* Determine priority | ||
* Determine locality | ||
* (or both) | ||
|
||
!SLIDE ruby | ||
|
||
# Priority | ||
|
||
## `$ QUEUES=high,low rake resque:work` | ||
|
||
!SLIDE ruby | ||
|
||
# Locality | ||
|
||
## `$ QUEUES=file_serve rake resque:work` | ||
|
||
!SLIDE ruby | ||
|
||
# Consume all queues | ||
|
||
## `$ QUEUES=* rake resque:work` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
!SLIDE bullets incremental | ||
|
||
# Jobs | ||
|
||
* Normal Ruby classes or modules | ||
* Must respond to `perform` | ||
* Any arguments are passed to `perform` | ||
* `@queue` class ivar determines queue | ||
|
||
!SLIDE ruby | ||
|
||
@@@ ruby | ||
class Archive | ||
@queue = :file_serve | ||
|
||
def self.perform(repo_id, branch = nil) | ||
repo = Repository.find(repo_id) | ||
repo.create_archive(branch || "master") | ||
end | ||
end | ||
|
||
!SLIDE ruby | ||
|
||
@@@ ruby | ||
Resque.enqueue(Archive, @repo.id, branch) | ||
|
||
!SLIDE ruby | ||
|
||
@@@ ruby | ||
Resque::Job.create(:file_serve, | ||
Archive, | ||
@repo.id, | ||
branch) | ||
|
||
!SLIDE | ||
|
||
# Persistence | ||
|
||
## Jobs are stored as JSON | ||
|
||
!SLIDE javascript | ||
|
||
@@@ javascript | ||
{ | ||
"class": "Archive", | ||
"args": [ 44, "masterbrew" ] | ||
} | ||
|
||
!SLIDE | ||
|
||
# Persistence | ||
|
||
## Only objects that can be serialized to JSON can be queued as args |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
!SLIDE bullets incremental | ||
|
||
# Things to Queue | ||
|
||
* Warming caches | ||
* Counting disk usage | ||
* Building tarballs | ||
* Firing web hooks | ||
|
||
!SLIDE bullets incremental | ||
|
||
# More Things to Queue | ||
|
||
* Creating events in the db | ||
* Building graphs | ||
* Deleting users (and their associated data) | ||
* Updating our search index | ||
|
||
!SLIDE bullets incremental | ||
|
||
# Even More Things to Queue | ||
|
||
* Sending Emails | ||
* Data integrity checks | ||
* Friendship graph assemblage |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
!SLIDE bullets incremental | ||
|
||
# Plugins | ||
|
||
* Resque featured locked until 2.0 | ||
* Focusing on stability and fault tolerance | ||
* Plugins are how to get more functionality | ||
|
||
!SLIDE | ||
|
||
# quirkey/resque-status | ||
|
||
## Provides simple trackable jobs. | ||
|
||
![octocat](octocat.png) | ||
|
||
!SLIDE | ||
|
||
# zapnap/resque_mailer | ||
|
||
## Send asynchronous email with ActionMailer. | ||
|
||
![octocat](octocat.png) | ||
|
||
!SLIDE | ||
|
||
# bvandenbos/resque-scheduler | ||
|
||
## A light-weight job scheduling system. | ||
|
||
![octocat](octocat.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
!SLIDE | ||
|
||
# ¡Resque! | ||
|
||
## http://bit.ly/resque | ||
## http://bit.ly/resque-post | ||
## git clone git://github.com/defunkt/resque |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
!SLIDE | ||
|
||
# Thanks! | ||
|
||
### ( Created using Showoff ) | ||
### ( schacon/showoff @ github ) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[ | ||
{"section":"resque"} | ||
] |