-
-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] - Several potential changes #762
Comments
@pcfreak30 I can see the value in these features beyond your use. Happy to review a PR. The diff you have looks pretty straightforward, just some comments and such needed 👍 |
One thing came to mind, would the as it stands I think it would need to be a go routine anyways to not block. but my case always uses it ATM. Thoughts? |
Good point, could do away with |
- Add `jobOutUpdateLockRequest` channel in the executor - Implement lock update requests in the job execution process - Add `Lock()` method to the `Job` interface - Update the scheduler to handle lock update requests - Add a test case to verify the new locking mechanism
@JohnRoesler i have created 2 prs that should sum up everything |
- Add `jobOutUpdateLockRequest` channel in the executor - Implement lock update requests in the job execution process - Add `Lock()` method to the `Job` interface - Update the scheduler to handle lock update requests - Add a test case to verify the new locking mechanism
- Add `jobOutUpdateLockRequest` channel in the executor - Implement lock update requests in the job execution process - Add `Lock()` method to the `Job` interface - Update the scheduler to handle lock update requests - Add a test case to verify the new locking mechanism
I believe this would need to be several PR's, but I want feedback on if they should be refactored upstream, the best approach?
v2...LumeWeb:gocron:expose_started_locker
Summary of changes:
executor.go
:jobOutUpdateLockRequest
to the executor struct.startedChan
when a job begins execution.job.go
:lastLock
to the job struct to store the most recent lock.startedChan
channel to the job struct.Started()
: Returns thestartedChan
.Lock()
: Returns thelastLock
.Context()
: Returns the job's context.scheduler.go
:jobOutUpdateLockRequest
for lock update requests.jobOutUpdateLockRequest
to handle these requests.jobOutUpdateLockRequest
to process lock updates.startedChan
.In summary
Job
interface method to get the active context. I use this to abort a monitor thread if the job is canceledLock
if it exists which requires new channel comms betweenscheduler
andexecuter
. I use this to managing the lock directly outside cron library.startedChan
andStarted
that flags when a task has begun but before the task function is called. I use this for a monitor to wait until the task is actually started.@JohnRoesler
The text was updated successfully, but these errors were encountered: