You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But, it would be nice if Promise.using also accepted an array. E.g.,
Promise.using(resources,functionhandler(){});
My specific use case is in a CI framework that spins up a number of dependent docker containers. The disposer method will remove the containers after the handling function has resolved.
The text was updated successfully, but these errors were encountered:
Hmm, the part that bothers me here is the fact that no other language/system with resource management provides this - there is something a little mutually exclusive between deterministic disposing of resources and a dynamic amount - I've never run into it in C# nor Python nor Java nor other languages I've used with resource management of that sort.
The container use case does sound like a very solid one - so I'm in favour of some sugar, fwiw in ES2015 it's:
Sometimes it can be useful to use the
using
/disposer
pattern with an unknown number of resources. It is possible to accomplish this with:But, it would be nice if
Promise.using
also accepted an array. E.g.,My specific use case is in a CI framework that spins up a number of dependent docker containers. The disposer method will remove the containers after the handling function has resolved.
The text was updated successfully, but these errors were encountered: