SlidePub
Home
Categories
Login
Register
Home
Technology
Introduction to Resque
Introduction to Resque
koshigoe
1,753 views
24 slides
Nov 20, 2009
Slide
1
of 24
Previous
Next
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
About This Presentation
社内勉強会での発表に使ったスライドです。
GitHub で使われているジョブキューシステムの Resque について、簡単に説明しています。
Size:
123.08 KB
Language:
en
Added:
Nov 20, 2009
Slides:
24 pages
Slide Content
Slide 1
Introduction to
Resque
Nov. 20, 2009 (Fri.)
Feedforce, Inc.
[email protected]
Slide 2
Resque
GitHub wÌ¿«¬å¢ïÅ rg;©á”
Ruby pî÷
´ãÒ‹ Ruby
JobObj.perform(*args)
Ô»Õ”µt Redis ›>;
git://github.com/defunkt/resque.git
ÞÇ»æï¬; WEB žÓ曉
Slide 3
Redis
Key-Value Store w°
http://code.google.com/p/redis/
ANSI C pî÷
POSIX ³µÂÜ Ípwˆ^›²
ìQ—ô—žÄÛ¿«—String, List, Set
ôSs‰—èÓæ”³ãï—sr
Ý ïÔ»Õ”µq`o‹b;Dó
Slide 4
Redis
$telnet localhost 6379
SET keyname 3
bar
+OK
GET keyname
$3
bar
Slide 5
Redis
http://w.koshigoe.jp/study/
Slide 6
GitHub wAE
ìQ
4;¤´ãÒw¬Ý
4;¤´ãÒwË ý
»¬
ŒS
ôs push/pop
ë”§”w Ý6(run/fin)
æ`h´ãÒw¬Ý
ë”§”w 4ƒ
fat, old, too long
ì$së”§”
æ`h´ãÒxfw‡‡
6‰zrL`sM
Slide 7
\•sœi
žÄÛ¿«tO(1)p push/pop
ô
‘s`t ïµÄ”çpV”
ôTpV” Ruby «å žïÄ
Ú™wÈ»›¨òpV”
T:§¢ï»›–Q”
ìQ
Úµ»—µè”ÒwèÓæ”³ãï
É¿Ä딫
Slide 8
Resque + Redis
A. Resis
©á”wðJ› Redis tÚd”
ë”§”wðJt ¯:›po”
D¹Qz ôTQz Ý6¹
Slide 9
Resque UeZÛOÄ
´ãÒwîæ
ë”§”—´ãÒ›¹b” WEB ï»Ñ£”µ
tQówhŠw fork ÞÃç
¦õDós曌’d”Ì¿«¤ïÅ
Hoptoad qT
„TzRedis wÍë”›¬d
Slide 10
DEMO
$ sudo gem install redis redis-namespace yajl-ruby \
--source=http://gemcutter.org
$ sudo gem install sinatra
$ git clone git://github.com/defunkt/resque.git
$ cd resque/examples/demo
$ rackup config.ru
$ open http://localhost:9292/
Slide 11
DEMO
$ VERBOSE=true QUEUE=default rake resque:work
Slide 12
DEMO
$ VVERBOSE=true QUEUE=default rake resque:work
Slide 13
DEMO
$ open http://localhost:9292/resque/
Slide 14
´ãÒ
class Archive
@queue = :file_serve
def self.perform(repo_id, branch = 'master')
repo = Repository.find(repo_id)
repo.create_archive(branch)
end
end
Slide 15
©á”t´ãÒ›
class Repository
def async_create_archive(branch)
Resque.enqueue(Archive, self.id, branch)
end
end
Slide 16
´ãÒ› “ Z`o
klass, args = Resque.reserve(:file_serve)
klass.perform(*args) if klass.respond_to? :perform
Slide 17
ë”§”Iˆ
$ cd app_root
$ QUEUE=file_serve rake resque:work
Slide 18
´ãÒw¾:x JSON
{
'class': 'Archive',
'args': [ 44, 'masterbrew' ]
}
Slide 19
´ãÒwæ›èŒ
´ãÒU«Ž›C\^dh’
é¬tGå`
Resque::Failure Þ´á”çtI^•”
æx Redis TwÌ¿«¤ïÅtI^•”
Resque x Hoptoad ›±Ù”Ä`oM”
http://www.hoptoadapp.com/pages/home
Slide 20
Resque vs DelayedJob
rj’TU ×t•oM”qMOépxsM
›Q›úr`z;Mt ao¬Rb‚V
Slide 21
Resque ›¬‚V
ó:w©á”UžA
:‹t‘”ŒSxÆA
Ruby ¦Ò´£«Äw‡‡¾:tIbžAUsM
‡ ×tŠGs©á”›{O
?UIVoM”T›¬Ý`hM
XwæÁŸ ‚›²q`oM”
Redis ›·¿Äž¿ÓpV”
RAM U –^bWsM
Slide 22
DelayedJob ›¬‚V
:‹t‘”ŒS›·‰
–Ô‡ ×tXw´ãÒ›îæb”˜ZpsM
©á”U –^XzbYtíX
XwæÁŸ ‚›²q`sM
ot?p‹©á”td[ˆhM
Redis w·¿Äž¿Ó›l‡sM
Slide 23
?q?
?lh?xsMZ?rz??????U?"
GitHub qMO(x$t G?s)?wUK?
Ruby ???swp(??w)q ?tÛ??M
Redis xAÏ‘M>U`oM”(?s`)
jlqiZ Ä`X → http://w.koshigoe.jp/study/
Resque
Redis
Slide 24
]ZÌzK“UqO]_M‡`h{
Tags
feedforce
ruby
programming
Categories
Technology
Download
Download Slideshow
Get the original presentation file
Quick Actions
Embed
Share
Save
Print
Full
Report
Statistics
Views
1,753
Slides
24
Favorites
5
Age
5857 days
Related Slideshows
11
8-top-ai-courses-for-customer-support-representatives-in-2025.pptx
JeroenErne2
46 views
10
7-essential-ai-courses-for-call-center-supervisors-in-2025.pptx
JeroenErne2
46 views
13
25-essential-ai-courses-for-user-support-specialists-in-2025.pptx
JeroenErne2
37 views
11
8-essential-ai-courses-for-insurance-customer-service-representatives-in-2025.pptx
JeroenErne2
34 views
21
Know for Certain
DaveSinNM
21 views
17
PPT OPD LES 3ertt4t4tqqqe23e3e3rq2qq232.pptx
novasedanayoga46
26 views
View More in This Category
Embed Slideshow
Dimensions
Width (px)
Height (px)
Start Page
Which slide to start from (1-24)
Options
Auto-play slides
Show controls
Embed Code
Copy Code
Share Slideshow
Share on Social Media
Share on Facebook
Share on Twitter
Share on LinkedIn
Share via Email
Or copy link
Copy
Report Content
Reason for reporting
*
Select a reason...
Inappropriate content
Copyright violation
Spam or misleading
Offensive or hateful
Privacy violation
Other
Slide number
Leave blank if it applies to the entire slideshow
Additional details
*
Help us understand the problem better