-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moves locking processing to the engine
* Adds `IMutexed` class. This can be implemented by an activity to signal that it can produce `Mutex` instances that are used to control when an activity should be run. * The `GenerateBillOfMaterialsActivity` creates a `Mutex` for each unique directory that it's is asked to run on. * If the `Mutex` can't be acquired right before the activity is handled, then it is placed back in the queue. This frees up the worker so that it can do other work. This is an improvement over the previous implementation because it was possible for all of the workers to be waiting on the same lock. With this approach that scenario is not possible. This also has the side benefit of it being to implement for future activities, and the activity's handle method doesn't have to be aware of the details of the locking mechanism.
- Loading branch information
1 parent
ea3fd1f
commit 92965c6
Showing
3 changed files
with
56 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System; | ||
using System.Threading; | ||
|
||
namespace Corgibytes.Freshli.Cli.Functionality.Engine; | ||
|
||
public interface IMutexed | ||
{ | ||
public Mutex GetMutex(IServiceProvider serviceProvider); | ||
} |