Skip to content
This repository has been archived by the owner on Jan 30, 2025. It is now read-only.

Add helpers for Async APIs #464

Merged
merged 10 commits into from
Jul 19, 2022
Merged

Add helpers for Async APIs #464

merged 10 commits into from
Jul 19, 2022

Conversation

inancgumus
Copy link
Member

@inancgumus inancgumus commented Jul 19, 2022

This PR closes #463.

  • k6ext.Promise makes it easier to work with promisified code.
  • k6ext.AbortingPromise is like Promise, allowing the event loop's abortion.
  • VU.RunLoop makes it easier to run an event loop.
  • testBrowser.await is a convenience function for VU.RunLoop. Awaits the given function until the event loop returns.
  • testBrowser.runString makes it easy to run strings with a fmt.Sprintf like behavior.

An example of refactoring can be seen in Browser.on and its tests.

@inancgumus inancgumus self-assigned this Jul 19, 2022
@inancgumus inancgumus requested a review from ankur22 July 19, 2022 06:34
@inancgumus inancgumus force-pushed the feat/async-api-refactoring branch from 90753c8 to 76b7e20 Compare July 19, 2022 11:34
@inancgumus inancgumus changed the title Refactoring for Async API Add helpers for Async APIs Jul 19, 2022
@inancgumus inancgumus merged commit bae63f6 into main Jul 19, 2022
@inancgumus inancgumus deleted the feat/async-api-refactoring branch July 19, 2022 11:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Helpers to streamline working with event loop
2 participants