forwardemail / forwardemail/supertest

Can multiple agents (sessions) be used in asynchronous requests?

Open
#454 1 comment 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.