Skip to content

Commit

Permalink
yay
Browse files Browse the repository at this point in the history
  • Loading branch information
defunkt committed Jan 22, 2010
0 parents commit 5054443
Show file tree
Hide file tree
Showing 13 changed files with 215 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
.DS_Store
Binary file added resque/1_overview/octocat.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 62 additions & 0 deletions resque/1_overview/overview.md
@@ -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)
Binary file added resque/1_overview/web-ui.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions resque/2_queues/queues.md
@@ -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`

53 changes: 53 additions & 0 deletions resque/3_queueing/queueing.md
@@ -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
25 changes: 25 additions & 0 deletions resque/4_uses/uses.md
@@ -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
Binary file added resque/5_plugins/octocat.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions resque/5_plugins/plugins.md
@@ -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)
7 changes: 7 additions & 0 deletions resque/6_get_resque/get_resque.md
@@ -0,0 +1,7 @@
!SLIDE

# ¡Resque!

## http://bit.ly/resque
## http://bit.ly/resque-post
## git clone git://github.com/defunkt/resque
6 changes: 6 additions & 0 deletions resque/7_fin/fin.md
@@ -0,0 +1,6 @@
!SLIDE

# Thanks!

### ( Created using Showoff )
### ( schacon/showoff @ github )
Binary file added resque/7_fin/octocat.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions showoff.json
@@ -0,0 +1,3 @@
[
{"section":"resque"}
]

0 comments on commit 5054443

Please sign in to comment.