memcachier / memjs

A memcache client for node using the binary protocol and SASL authentication
MIT License
197 stars 52 forks source link

add promise support #100

Closed nbransby closed 7 years ago

nbransby commented 7 years ago

This commit adds support for returning promises from the operation functions if a callback is not supplied.

Im aware this is a breaking change as operations called by existing code which does not pass a callback (or passes undefined) will not execute.

It is still possbile to execute the operation without a callback though by passing null or false instead of omitting the arg

alevy commented 7 years ago

I suspect not supporting calls with no callback is not a big deal, and supporting promises seems important. Will leave this up to see if anyone yells at us about this, but are you able to fix the build error meanwhile?

nbransby commented 7 years ago

Yes it's due to use of arrow function will fix tonight On Thu, 18 May 2017 at 16:33, Amit Levy notifications@github.com wrote:

I suspect not supporting calls with no callback is not a big deal, and supporting promises seems important. Will leave this up to see if anyone yells at us about this, but are you able to fix the build error meanwhile?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/alevy/memjs/pull/100#issuecomment-302441803, or mute the thread https://github.com/notifications/unsubscribe-auth/ABUob5fqo0VdPqF4ypACMiGB1jHzfo8Uks5r7GTAgaJpZM4Nce5c .

sushantbs commented 7 years ago

Any updates on the status of this?

nbransby commented 7 years ago

I got all the tests passing except for 2 but I think these failing have nothing to do with the changes I made @alevy ? https://travis-ci.org/alevy/memjs/jobs/234402402

alevy commented 7 years ago

Yes I think it's only still including that test because there is a conflict that needs to be resolved to merge with current master (which doesn't include the failing tests).

I'll resolve and merge.

ovidiusabou commented 6 years ago

are you going to release a new version with this? it looks really useful

alevy commented 6 years ago

Yes, I'll do that now. Will publish a non-RC 1.0 first, then bump to 1.1 RC. Sound reasonable?

ovidiusabou commented 6 years ago

Yes, but please also look at https://github.com/alevy/memjs/pull/106 first