Question: We need to load test an web application using `SignalR` in few components with transport mode as long polling. My script gets hang in connect step. Connect step is `GET- /signalr/connect?transport=foreverFrame&clientProtocol=1.5&connectionToken=ZW6cj17pImmCjGGBQSQNy%2Bdiy7DKDUy4i4R1AE78c%2FTitzS6QgiPoX6fM3zBOrDK11hyx0QNEc92JM6bsLY19MCt5JjaYFgdTDVsbxfnRbkqKp6dpsl64BV1zI8Vu1X%2F&connectionData=%5B%7B%22name%22%3A%22mypreviewhub%22%7D%5D&tid=10&frameId=1`

I have correlated following 2 parameters- 1) captured connection token from negotiate step and used in subsequent requests 
2) used `${__time()}` for timestamp as found in link- [How to capture signalR connection string in Jmeter](https://stackoverflow.com/questions/49648779/how-to-capture-signalr-connection-string-in-jmeter/52273372#52273372)

Apart from these, I can see 2 more parameters being send in connect step- tid and frameid. Do we need to correlate these 2 parameters as well, although these are not used anywhere else apart from connect step?

Or what is that my script lacking? 

In various posts, I have seen suggestions to use websocket sampler plugins but I believe that can be helpful, if your SignalR use websocket mechanism, not long polling.

Please help me resolve this issue. Your help is appreciated. Thanks

Answer: 
You can also use Future.forEach with a map like this :

```
await Future.forEach(myMap.entries, (MapEntry entry) async {
  await myAsyncFunc();          
});
callFunc();

```
entries used in extract Maplist from HashMap.

```
 products.entries.forEach((e) {
  var key = e.key;
  var values = e.value;
    double sum = 0;
    values.forEach((value) => sum += value[PlanogramShelf.SHELF_FULL]);
    target.add(OrdinalSales(
        key, double.parse((sum / valueslength).toStringAsFixed(2))));
  });

```