-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added timeout mechanism to make scheduler adapt faster
* Extracted all constants controlling scheduler to AdaptivePollingReceiver * Added role interface for the back-off strategy * Decoupled the sender and receiver from the pipeline ContextItemRemovalDisposable * Removed the ITaskTracker abstraction
- Loading branch information
1 parent
ce80620
commit 7b37d23
Showing
19 changed files
with
234 additions
and
126 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
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
21 changes: 0 additions & 21 deletions
21
src/NServiceBus.SqlServer/CallbackQueuePipelineContextExtensions.cs
This file was deleted.
Oops, something went wrong.
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,23 @@ | ||
namespace NServiceBus.Transports.SQLServer | ||
{ | ||
using System; | ||
|
||
class ExecutorTaskState | ||
{ | ||
int seen; | ||
|
||
public void Reset() | ||
{ | ||
seen = 0; | ||
} | ||
|
||
public void TriggerAnotherTaskIfLongRunning(Action triggerAction) | ||
{ | ||
seen += 1; | ||
if (seen == 2) | ||
{ | ||
triggerAction(); | ||
} | ||
} | ||
} | ||
} |
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 @@ | ||
namespace NServiceBus.Transports.SQLServer | ||
{ | ||
using System; | ||
|
||
interface IBackOffStrategy | ||
{ | ||
void ConditionalWait(Func<bool> condition, Action<int> waitAction); | ||
} | ||
} |
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,33 @@ | ||
namespace NServiceBus.Transports.SQLServer | ||
{ | ||
using NServiceBus.Pipeline; | ||
|
||
interface ICallbackAddressStore | ||
{ | ||
void SetCallbackAddress(Address callbackAddress); | ||
Address TryGetCallbackAddress(); | ||
} | ||
|
||
class ContextualCallbackAddressStore : ICallbackAddressStore | ||
{ | ||
readonly BehaviorContext behaviorContext; | ||
const string SqlServerCallbackAddressContextKey = "SqlServerCallbackAddress"; | ||
|
||
public ContextualCallbackAddressStore(BehaviorContext behaviorContext) | ||
{ | ||
this.behaviorContext = behaviorContext; | ||
} | ||
|
||
public void SetCallbackAddress(Address callbackAddress) | ||
{ | ||
behaviorContext.Set(SqlServerCallbackAddressContextKey,callbackAddress); | ||
} | ||
|
||
public Address TryGetCallbackAddress() | ||
{ | ||
Address callbackAddress; | ||
behaviorContext.TryGet(SqlServerCallbackAddressContextKey, out callbackAddress); | ||
return callbackAddress; | ||
} | ||
} | ||
} |
Oops, something went wrong.