Comments (6)
Maybe you can use the same api as the Readable Stream. So that you can change the encoding of messages using a method .setEncoding(encoding).
If you then want your new API to be backwards compatible with the current one, you could set the default encoding to "utf8"
. And users that need raw buffer access can simply call Zyre#setEncoding(null)
, an API they are already comfortable with since this is the common way to this in NodeJS API's.
from zyre.js.
Good idea! I will look into this and update the binary-messages branch.
Would be great if you test it when it's updated.
from zyre.js.
Yes, it's possible.
I am already testing it in binary-messages. I am just not sure about usability, because if I change the API, a console.log(msg)
will result in a <Buffer 61 73 64 66>
. You would have to use console.log(msg.toString())
to read string
messages.
Sending messages would be no problem, as zyre.whisper()
and zyre.shout()
accept raw buffers as well.
If you want to test raw buffers now on your side, you could add "zyre.js": "interpretor/zyre.js#binary-messages"
as a dependency in package.json
.
Let me know how you think about it, and then we could add this in a new release.
from zyre.js.
Sure, I would be happy to test it!
And thanks for your nice API, it makes things way simpler than trying to use the official NodeJS Zyre binding 🙂.
from zyre.js.
I pushed a commit which adds support for multiple encodings plus the possibility to receive raw Buffers. d4fa967
from zyre.js.
Merged to master
from zyre.js.
Related Issues (8)
- Lost JOIN messages HOT 1
- An in-range update of nyc is breaking the build 🚨 HOT 1
- An in-range update of debug is breaking the build 🚨 HOT 2
- An in-range update of mocha is breaking the build 🚨 HOT 10
- Fast reconnection won't accept Shout to work properly HOT 5
- An in-range update of zeromq is breaking the build 🚨 HOT 1
- iface selection HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zyre.js.