stoplightio / prism

Turn any OpenAPI2/3 and Postman Collection file into an API server with mocking, transformations and validations.
https://stoplight.io/open-source/prism
Apache License 2.0
4.32k stars 350 forks source link

Ability to limit simultaneous Async Requests #175

Closed krismeister closed 5 years ago

krismeister commented 6 years ago

FEATURE REQUEST Make configurable ability to limit qty of simultaneous asynchronous requests.

Use Case Underpowered CI servers can't handle huge quantities of simultaneous API requests.

We currently run 3000+ tests when we build in our CI environment. This high number is due to deep dependancies between our restfull api. You can't create a Contact without a Company. You can't create a Company without creating a Company Category etc. We manage these dependancies through references between Scenarios. As a result to a test changing a Contact email, you've had to create all the other portions.

tbarn commented 6 years ago

Thanks for submitting this @krismeister! I know y'all are Scenarios superusers over there. We'll try to see where this fits into the Prism roadmap. There's a lot of work being done on Prism right now.

philsturgeon commented 5 years ago

I really like this idea. The majority of work being done is now on Prism v3.0, which is currently in alpha (#266).

The new TypeScript based v3.0 branch uses Fastify, which has a rate limiting middleware. Should we add this as a configurable option? Or maybe we could just work on making middlewares in general configurable and document this as an example.

philsturgeon commented 5 years ago

Oh no ignore me, this isn't what you want, but the generic middleware stuff will probably happen elsewhere anyway. :)

philsturgeon commented 5 years ago

Prism v3.0 won't have scenarios, but similar stuff will be back in the future. When that functionality arises, we'll make sure we have options to limit the concurrency of the test runner.