GearmaNode
GearmaNode copied to clipboard
Cancel a job
There is any way to cancel a job after sometime?
let job = client.submitJob('test', 'a')
// I need to cancel this job after 60 seconds, how I do this?
Updated:
I noticed that someone can cancel a job use gearadmin
.
~~No, there is no way to cancel in Gearman protocol.~~ Actually, there is a function related to this behavior in Gearman server's code,which is in C language:
gearmand_error_t gearman_server_job_cancel(gearman_server_st& server,
const char *job_handle,
const size_t job_handle_length)
~~But, there is no cancel
protocol in Gearman Protocol Specification.~~
what about CAN_DO_TIMEOUT
- see http://gearman.org/protocol/
- see 'timeout' parameter here: https://github.com/veny/GearmaNode#register-function
@veny maybe the gearman_server_job_cancel
is an inner function? if not we should implement the protocol.
CAN_DO_TIMEOUT
is not exactly the same with cancel.