forwardemail / forwardemail/supertest
Can multiple agents (sessions) be used in asynchronous requests?
- Dominant language
- JavaScript
- Stars
- 14.4k
- Forks
- 782
- PR merge metrics
- No merged PRs in 30d
Description
I'd like to be able to execute a set of requests asynchronously against my app, each with a different session.
For example, have some for loop make many calls to an async method that makes one or more requests against the app, each set of requests with its own session, return an array of promises which can be acted on when they all resolve.
In each call made by the loop I'd like to create a discrete agent (so sessions are separate) to make the series of http requests in that call.
What I have right now doesn't seem to work - it seems as though request data in an earlier iteration is being overwritten by data in a later iteration, and my guess is they're using the same agent. How can I create discrete, independent agents for making multiple simultaneous requests with independent sessions?
Contributor guide
Assessment
This issue has not been assessed yet.