I've often come across situations where I wish I could declare a semaphore for a certain service context rather than globally locking against the service name.
An example might be a service that pulls in data from external sources where an input parameter (datasourceId) defines which external source to pull from. If this service runs hourly against each datasourceId but sometimes an import takes longer than an hour, then you end up with two executions of the service trying to pull in from the same datasourceId. It would be nice if you could fail the 2nd call to that datasourceId but allow instances of the service to run against other datasourceIds.
I've often come across situations where I wish I could declare a semaphore for a certain service context rather than globally locking against the service name.
An example might be a service that pulls in data from external sources where an input parameter (datasourceId) defines which external source to pull from. If this service runs hourly against each datasourceId but sometimes an import takes longer than an hour, then you end up with two executions of the service trying to pull in from the same datasourceId. It would be nice if you could fail the 2nd call to that datasourceId but allow instances of the service to run against other datasourceIds.