Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add binary-safe alternatives for eval #183

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mspielberg
Copy link

Currently the only externally accessible commands for EVAL and friends take Seq[String] for keys and arguments. String can only contain valid UTF-8 sequences, which makes it impossible to send arbitrary binary data to a Lua script, for example to do a compare-and-set of compressed data.

This exposes a new evalBinary method and related equivalents that expose the ability for an application to provide its own ByteStringSerializer instances for arguments to scripts. Note these can't easily be written as simple overloads because the erased type of the arguments (Seq[_]) would be identical to the existing Seq[String] methods.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 90.735% when pulling de38924 on mspielberg:master into 55573df on etaty:master.

@btd
Copy link
Contributor

btd commented Jun 7, 2017

Ping @etaty .This PR very useful, i hit exactly the same limitation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants