Skip to content
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

feat: opportunity to realize graceful stopping IJobWorker instances #624

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Client/Api/Worker/IJobWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@ public interface IJobWorker : IDisposable

/// <returns>true if this registration is not open and is not in the process of opening or closing</returns>
bool IsClosed();

void StopPooling();
}
}
5 changes: 5 additions & 0 deletions Client/Impl/Worker/JobWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ public bool IsClosed()
return !isRunning;
}

public void StopPooling()
{
source.Cancel();
}

/// <summary>
/// Opens the configured JobWorker to activate jobs in the given poll interval
/// and handle with the given handler.
Expand Down