Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run flow elements in parallel #164

Closed
jmredfern opened this issue Sep 7, 2016 · 5 comments
Closed

Run flow elements in parallel #164

jmredfern opened this issue Sep 7, 2016 · 5 comments

Comments

@jmredfern
Copy link

To simulate browser calls which happen in parallel:

    "scenarios": [
        {
            "flow": [
                [
                    {
                        "get": {
                            "url": "/rest/events",
                        }
                    },
                    {
                        "get": {
                            "url": "/rest/stream",
                        }
                    }
                ]
            ]
        }
    ]
@hassy
Copy link
Member

hassy commented Sep 8, 2016

Could you explain the use case a little bit more @jmredfern? If you could mark a request as async (e.g. with something async: true) to make Artillery not wait for a response, would that do what you need it to do?

@hassy
Copy link
Member

hassy commented Nov 24, 2016

Closing as there are no plans to implement this for now - can be re-visited and re-opened again later.

@hassy hassy closed this as completed Nov 24, 2016
@clarkie
Copy link

clarkie commented Jun 24, 2017

I have a use case for this. We have a route that returns configuration for a home page which in turn gives the client a number of sources to go and get further data from. The second set of requests would be called in parallel by a normal browser.

For example the response from the first request could be something like this:

[
  {
    "source": "/curations/94afe353-8b89-4085-8c06-a10cde5f70e5/products",
    "title": "Collections",
  },
  {
    "source": "/curations/4e19b3fd-1ea8-455b-b7b4-83abd64a1884/products",
    "title": "Popular this week",
  },
  {
    "source": "/curations/ec2019d9-d2a0-4e7e-88b8-93f19b868e1b/products",
    "title": "New and noteworthy",
  }
]

we'd then want to call each source url in parallel.

What do you reckon?

@hassy
Copy link
Member

hassy commented Jun 24, 2017

Yeah I see what you're trying to do. That would also require a mechanism to dynamically set up new requests in the running scenario - there isn't a way to do it at the moment.

One way to achieve what you're trying to do is a hook function, which can be as simple as Promise.all()ing a bunch of requests.

@clarkie
Copy link

clarkie commented Jun 25, 2017

Ah, yeah, I don't mind hardcoding the response's urls but yeah, that should work for me. I'll report back once I've tried it

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants