|
Revision 326, 0.5 kB
(checked in by gethema..@gmail.com, 6 months ago)
|
check in new backgroundrb code
|
| Line | |
|---|
| 1 |
# Put your code that runs your task inside the do_work method it will be |
|---|
| 2 |
# run automatically in a thread. You have access to all of your rails |
|---|
| 3 |
# models. You also get logger and results method inside of this class |
|---|
| 4 |
# by default. |
|---|
| 5 |
class ErrorWorker < BackgrounDRb::MetaWorker |
|---|
| 6 |
set_worker_name :error_worker |
|---|
| 7 |
set_no_auto_load(true) |
|---|
| 8 |
|
|---|
| 9 |
def create(args = nil) |
|---|
| 10 |
logger.info "creating error worker" |
|---|
| 11 |
end |
|---|
| 12 |
|
|---|
| 13 |
def hello_world(data) |
|---|
| 14 |
logger.info "invoking #{worker_name} hello world #{data} #{Time.now}" |
|---|
| 15 |
end |
|---|
| 16 |
end |
|---|
| 17 |
|
|---|