GearmaNode icon indicating copy to clipboard operation
GearmaNode copied to clipboard

Cancel a job

Open herlon214 opened this issue 8 years ago • 3 comments

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?

herlon214 avatar Aug 26 '16 19:08 herlon214

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.~~

mike442144 avatar Sep 18 '16 06:09 mike442144

what about CAN_DO_TIMEOUT

  1. see http://gearman.org/protocol/
  2. see 'timeout' parameter here: https://github.com/veny/GearmaNode#register-function

veny avatar Feb 08 '17 20:02 veny

@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.

mike442144 avatar Feb 13 '17 12:02 mike442144