coopernurse / node-pool

Generic resource pooling for node.js
2.38k stars 259 forks source link

V3 release stuff #150

Closed sandfox closed 7 years ago

sandfox commented 8 years ago

TODOs and DREAMS:

Release blockers

felixfbecker commented 8 years ago

make a factory for pool

why this?

change acquire to return a promise make drain return a promise make destroyAllNow return promise

❤️

make and expose Error classes???

👍

Please consider a pre-release, I would be happy to use the promises in a new project atm :)

felipou commented 8 years ago

Awesome! How can I help?

felixfbecker commented 8 years ago

make generic "collection" thing that supports indexes and use it power PooledResourceCollection (like Deferred does ResourceRequest)

What do you mean by this? I always favor ES6 collections

sandfox commented 8 years ago

@felixfbecker

make a factory At some point I'd like to make the Pool class less responsible for instantiating it's own dependencies so that easier for people to replace various implementations of things, and also allows internal changes to be made more easily without breaking the external API.

make generic "collection" thing that supports indexes and use it power PooledResourceCollection (like Deferred does ResourceRequest)

I'm already using Set/Map etc but In some case I need to index the contents of a those collections by some other key. If you look at PooledResourceCollection you might see what I mean. (although I have just changed the internals a bit so exact use-case might have gone!)

Please consider a pre-release, I would be happy to use the promises in a new project atm :) the v3 branch v3-alpha is available on npm under the next tag

npm install [--save] generic-pool@next

I'll try to keep the npm next version up to date with the v3-alpha branch as much as possible. I'm also going to probably add/remove/re-arrange the todo list above a bit. it was just a brain dump.

There is one breaking change the current v3 api I'm going to make soon, and that is to have release/destroy return a promise. Other than that I think it's pretty fixed API wise, but open to suggestions.

sandfox commented 8 years ago

@felipou The biggest/most useful thing would be if you could try using this new version anywhere. I'd like to iron out the external API as much as possible so that v3 can be released, internals can be fixed/changed later.

In terms of work there the tests and the documentation is still patchy and a mess, and something does need to be done about examples and I want to write a migration guide somewhere to help people move from v2 - I know some people are going to dislike the promise change and I want to show them various ways they can adapt to it, or at least inter-op their callback code with it.

sandfox commented 7 years ago

this is now released... let the bugs roll in :-p