Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Goworker - A Resque backround worker in Go
Search
Mike
May 13, 2014
Programming
340
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Goworker - A Resque backround worker in Go
An intro for Rubyists on background processing Resque jobs using Go
Mike
May 13, 2014
Other Decks in Programming
See All in Programming
気持ちぃ〜角丸 Squircle
ryu1013
0
310
コーディング自動化の次へ。人の介入をゼロにするファクトリーとサポートAIによる実践
timakin
5
3.6k
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
5.2k
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
1k
[Dev Group Paris Octobre 26] Agentforce, SIforce, Claudeforce, Slackbot… on s'y retrouve ?
nabondance
0
110
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
ChromeでローカルLLM
ryu1013
0
140
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
390
Unity6 URPによる海底をテーマにしたVJシステムの解説 | Unity Shader 完全に理解した 勉強会
gam0022
0
370
Simple Storage Service(S3) is not simple
iwatsukayura
0
290
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
750
npm との違いを手がかりにGo の依存管理を理解したい
optim
0
380
Featured
See All Featured
エンジニアに許された特別な時間の終わり
watany
109
250k
30 Presentation Tips
portentint
PRO
1
430
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
270
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
480
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
330
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
59k
RailsConf 2023
tenderlove
30
1.6k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.4k
Transcript
a Go-based background worker for Resque
What is Go? ❏ compiled (fast) ❏ strongly typed ❏
first class functions ❏ concurrent ❏ C-style syntax
❏ a single binary ❏ polls Resque-Queues ❏ manages worker
state ❏ dispatches jobs via goroutines What is Goworker?
How does it work? Enqueue a Job in Ruby Land:
❏ RPOP the job from Redis ❏ parse JSON ❏ find worker func for class ❏ call worker func with args Same as: redis-cli RPUSH resque:queue:hello '{"class": "Hello", "args": ["World"]}'
WTF is a worker func? ❏ takes two Arguments: ❏
queue name ❏ Array of unspecified args ❏ returns an error on failure
Putting it together Define a main-func like in C: File
worker.go Register your worker-func: File hello_worker.go
Run it! go get github.com/benmanns/goworker (install library + dependencies) go
build (compile code + create executable) ./worker -queues=hello (run it + spawn 25 workers by default)
Type assertions ❏ Type-asserting all args can be quite tedious
❏ want to use custom argument types ❏ define structs
using structs https://github. com/mikezter/goworker/tree/worker-interface ❏ automatically type assert nested structures
❏ uses json.Unmarshal ❏ defines worker-interface:
Questions?