public abstract class AbstractAdminClient extends Object implements AdminClient
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractAdminClient(Config config) |
| Modifier and Type | Method and Description |
|---|---|
static void |
doPublish(redis.clients.jedis.Jedis jedis,
String namespace,
String channel,
String jobJson)
Helper method that encapsulates the minimum logic for publishing a job to a channel.
|
protected abstract void |
doPublish(String queue,
String msg)
Actually publish the serialized job.
|
protected String |
getNamespace() |
void |
publish(Job job)
Publishes a job on the
ResqueConstants.ADMIN_CHANNEL channel. |
void |
publish(String channel,
Job job)
Publishes a job on the given channel.
|
void |
shutdownWorkers(boolean now)
Send a shutdown command on the
ResqueConstants.ADMIN_CHANNEL channel. |
void |
shutdownWorkers(String channel,
boolean now)
Send a shutdown command on the given channel.
|
void |
togglePausedWorkers(boolean paused)
Send a pause command on the
ResqueConstants.ADMIN_CHANNEL channel. |
void |
togglePausedWorkers(String channel,
boolean paused)
Send a pause command on the given channel.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitendprotected AbstractAdminClient(Config config)
config - used to get the namespace for key creationprotected String getNamespace()
public void shutdownWorkers(boolean now)
AdminClientResqueConstants.ADMIN_CHANNEL channel.shutdownWorkers in interface AdminClientnow - if true, an effort will be made to stop any job in progresspublic void shutdownWorkers(String channel, boolean now)
AdminClientshutdownWorkers in interface AdminClientchannel - the channel to publish the pause command tonow - if true, an effort will be made to stop any job in progresspublic void togglePausedWorkers(boolean paused)
AdminClientResqueConstants.ADMIN_CHANNEL channel.togglePausedWorkers in interface AdminClientpaused - if true, the workers will not process any new jobs;
if false, the workers will process new jobspublic void togglePausedWorkers(String channel, boolean paused)
AdminClienttogglePausedWorkers in interface AdminClientchannel - the channel to publish the pause command topaused - if true, the workers will not process any new jobs;
if false, the workers will process new jobspublic void publish(Job job)
AdminClientResqueConstants.ADMIN_CHANNEL channel.publish in interface AdminClientjob - job the job to be publishedpublic void publish(String channel, Job job)
AdminClientpublish in interface AdminClientchannel - the channel to publish the job tojob - job the job to be publishedprotected abstract void doPublish(String queue, String msg) throws Exception
queue - the queue to add the Job tomsg - the serialized JobException - in case something goes wrongpublic static void doPublish(redis.clients.jedis.Jedis jedis,
String namespace,
String channel,
String jobJson)
jedis - the connection to Redisnamespace - the Resque namespacechannel - the channel namejobJson - the job serialized as JSONCopyright © 2011-2013. All Rights Reserved.