Class RetryingPoller
Keeps a list of callbacks, and calls them repeatedly, until the list doesn't change during the calls.
Namespace: Responsible.Utilities
Assembly: Responsible.dll
Syntax
public class RetryingPoller
Remarks
May be used to build your own TestInstructionExecutor. The behavior provided by this class is intended for running tests as fast as possible, assuming polling is a relatively cheap operation to execute, and that executing some operations may complete other wait conditions.
The implementation focuses on simplicity (of code) over performance. It's unlikely to become a performance bottleneck, but if this does happen for you, please consider opening an issue or contributing code for a more performant poller.
Methods
Poll()
Calls all the registered callbacks at least once, and keeps calling them until none of the callbacks end up unregistering old callbacks or registering new callbacks.
Declaration
public void Poll()
RegisterPollCallback(Action)
Registers a callback to be called at least once when Poll() is called.
Declaration
public IDisposable RegisterPollCallback(Action action)
Parameters
Type | Name | Description |
---|---|---|
Action | action | Callback to be called |
Returns
Type | Description |
---|---|
IDisposable | A disposable, which will remove this callback when disposed. |