Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

more docs for workers

  • Loading branch information...
commit 77d0535938b1c905bfbe48ab020f6a43610d2adb 1 parent 3b1ec1d
@gnufied authored
Showing with 20 additions and 0 deletions.
  1. +19 −0 doc/content/rails/rails.txt
  2. +1 −0  doc/content/workers/workers.txt
View
19 doc/content/rails/rails.txt
@@ -79,6 +79,25 @@ rails using:
You can as usual use @worker_key@ if *worker was started with a worker_key*.
+p(sub-title). Enqueue task to the persistent job queue :
+
+Jobs executed via synchronous and asynchronous APIs are fine, but these tasks are usually
+kept in memory(and hence they are fast) and hence aren't entirely failsafe.
+
+To solve this _BackgrounDRb_ also lets you add jobs to a persistent job queue, which is
+automatically picked by responsible worker and invoked. To use this:
+
+<pre class="boxed">MiddleMan(:hello_worker).enq_some_task(:arg => "hello_world",:job_key => "boy")</pre>
+
+With _BackgrounDRb_ version >= 1.1, you can also schedule a persistent task to be executed at a particular time,
+
+<pre class="multiline">MiddleMan(:hello_worker).enq_some_task(:arg => "hello_world",
+ :job_key => "boy",:scheduled_at => (Time.now + 1.hour))</pre>
+
+Above line will add specified task to the job queue and set to be invoked at specified time. For more information
+about scheduling see scheduling section.
+
+
p(sub-title). Start a Worker :
To start a worker from rails:
View
1  doc/content/workers/workers.txt
@@ -154,6 +154,7 @@ class HelloWorker
end
end</pre>
+
%(entry-title)<a href="testing">Testing Workers </a>%
_BackgrounDRb_ comes with a baked in mechanism to write test cases. First make sure that you
Please sign in to comment.
Something went wrong with that request. Please try again.