7 #include <redis3m/patterns/script_exec.h>
8 #include <redis3m/connection.h>
9 #include <boost/date_time/posix_time/ptime.hpp>
10 #include <boost/date_time/posix_time/posix_time_duration.hpp>
38 void append_enqueue(connection::ptr_t
connection,
const std::string& object_id,
const boost::posix_time::ptime& time);
46 void append_enqueue(connection::ptr_t connection,
const std::string& object_id,
const boost::posix_time::time_duration& delay);
54 void enqueue(connection::ptr_t connection,
const std::string& object_id,
const boost::posix_time::ptime& time);
62 void enqueue(connection::ptr_t connection,
const std::string& object_id,
const boost::posix_time::time_duration& delay);
70 void append_dequeue(connection::ptr_t connection,
const std::string& object_id);
78 void dequeue(connection::ptr_t connection,
const std::string& object_id);
88 std::string
find_expired(connection::ptr_t connection,
const boost::posix_time::time_duration& lock_for=boost::posix_time::seconds(60));
void append_dequeue(connection::ptr_t connection, const std::string &object_id)
Append Redis commands to remove a job from queue, use it when worker ends a job. Otherwise it will fi...
Definition: scheduler.cpp:48
scheduler(const std::string &queue_name)
Scheduler constructor.
Definition: scheduler.cpp:14
The connection class, represent a connection to a Redis server.
Definition: connection.h:27
std::string find_expired(connection::ptr_t connection, const boost::posix_time::time_duration &lock_for=boost::posix_time::seconds(60))
Return a fired job, it will be locked for an amount of time. During this time the worker will run the...
Definition: scheduler.cpp:59
void dequeue(connection::ptr_t connection, const std::string &object_id)
Remove a job from queue, use it when worker ends a job. Otherwise it will fire on another worker...
Definition: scheduler.cpp:53
Helps to run Lua scripts on a Redis instance. It will take care to use EVALSHA to optimize performanc...
Definition: script_exec.h:21
A scheduler pattern, can be useful to manage "jobs" that needs to be run at a given time...
Definition: scheduler.h:23
void append_enqueue(connection::ptr_t connection, const std::string &object_id, const boost::posix_time::ptime &time)
Append Redis commands needed to enqueue a job, useful to use inside transactions. ...
Definition: scheduler.cpp:20
void enqueue(connection::ptr_t connection, const std::string &object_id, const boost::posix_time::ptime &time)
Put a job in schedule.
Definition: scheduler.cpp:34