Custom action while await
See original GitHub issuehi! Thank you very much for the tool, it’s very useful!
could you tell me, is it possible to do some custom action while condition waiting? something like this:
// Publish an asynchronous event:
publishEvent(updateCustomerStatusEvent);
// Awaitility lets you wait until the asynchronous operation completes:
await()
.atMost(5, SECONDS)
.do(() -> pollEvent())
.until(customerStatusIsUpdated());
and i expect that the method pollEvent()
will be called by awaitility before check the condition.
now i use
// Publish an asynchronous event:
publishEvent(updateCustomerStatusEvent);
// Awaitility lets you wait until the asynchronous operation completes:
await()
.atMost(5, SECONDS)
.until(() -> {
pollEvent();
customerStatusIsUpdated()
});
but it’s not elegant )
of course the method pollEvent
should be non-blocking
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (4 by maintainers)
Top Results From Across the Web
WIX C# custom actions with async await - Stack Overflow
I tried to make CheckDbConfig not async and use Task.WaitAll(tasks, 10000) and it worked. But when I use Task.WaitAll(tasks) without time, ...
Read more >Async actions in bare Redux with Thunk or custom middleware
Learn how to manage asynchronous actions in React apps with Redux Toolkit, or a bare Redux implementation with custom middleware.
Read more >await anything; - .NET Parallel Programming
The second approach to making an awaitable type is to implement a custom awaiter. This could either be a separate type that's returned...
Read more >Developing Custom Gradle Task Types
await () method. Note that Gradle will only begin running other independent tasks in parallel when a task has exited a task action...
Read more >createAsyncThunk - Redux Toolkit
payloadCreator · arg : a single value, containing the first parameter that was passed to the thunk action creator when it was...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi I have created PR for this issue. I am agree with @johanhaleby that is should not be exposed in the API and later on moved to a separate module. I have created to sample building block andThen and andBefore as a first draft. (still in WIP waiting for feedback)
@johanhaleby IMHO, it is not really worth to add that complexity…