memjs
memjs copied to clipboard
Get() header data type
Hi, When returning data from a .get() request I need to identify if the data was .set() using a buffer or a string. I'm assuming I could access this information from the header? but it's not included with the get callback.
Without having to track the data types <-> keys in my application, could this be achieved if the header data was returned in the get() callback?
Thanks, Adam.
Well, part of the header is returned, specifically the flags
part, which I think is exactly the thing you'd want to use for this. Unfortunately, there is not yet support for actually setting the flags.
This is mostly blocked on changing the format of arguments to MemJS operations, the only way to add it now is add it after
the callback argument, which is different from the Node conventions.
If we got flags working, do you think that would solve your problem?
Yes, i believe that would solve the problem. Do you think it would take long to implement (I'm not expecting you to do it anytime soon, I'm just curious if you think it would be much work)?
I don't see a problem defying the node conventions to maintain backwards compatibility. You could always release in tandem a 1.x version that adheres to node conventions?
I think it wouldn't be about at most a day's worth of work to support this.
Merging #87 should make this very easy.