Comments (7)
Probably not, @visionmedia can correct me but exposing the stream (for the use of composing new streams) wouldn't really mesh well with the protocol, really even with the messaging paradigm in general because of the whole <length> + <body>
.
from axon.
I dont recall us even having a .createStream() anywhere
from axon.
I just wondered if it would be possible. I want to use axon-rcp for auth stuff and thus need encryption, that's my use case...
from axon.
Yeah, I assumed @juliangruber meant add one to the api. Like mongoose or something, ala:
subSocket.stream().pipe(whatever);
Right?
from axon.
server:
var rpc = require('axon-rpc')
, axon = require('axon')
, rep = axon.socket('rep')
, net = require('net');
var server = new rpc.Server(rep);
// instead of this: rep.bind(4000);
net.createServer(function (socket) {
socket.pipe(server.createStream()).pipe(socket)
}).listen(4000)
client:
var rpc = require('axon-rpc')
, axon = require('axon')
, req = axon.socket('req')
, net = require('net');
var client = new rpc.Client(req);
var clientStream = client.createStream();
// with the net module
clientStream.pipe(net.connect(4000)).pipe(clientStream());
// or with dominictarr's reconnect:
reconnect(function (stream) {
clientStream.pipe(stream).pipe(clientStream)
}).connect(4000)
This way you make it transport agnostic and it will also work in the browser over websockets, or whatevs!
from axon.
im fine with it as long as:
- a) we dont overly complicate internals to abstract out accepting socket connections etc
- b) we dont change the existing default api
- c) performance is retained
though personally there wouldn't really be many use-cases to use it for anything but regular tcp, not all transports have the same capabilities, via stdin etc would be leaky
from axon.
👍
from axon.
Related Issues (20)
- Get a callback on the send method
- Allow disabling of the queue HOT 1
- push/pull where pullers pull upon demand
- Support for multiple peers needs improvement HOT 2
- Error on connect for sub socket HOT 4
- subscribers cannot send messages HOT 1
- Send command
- socket.connect blocking gulp task from completing HOT 3
- Binding to UNIX sockets results with RangeError HOT 3
- Is this maintained? HOT 2
- How would I go about tracing RPC(req-rep) calls?
- update package JSON engine values HOT 1
- How to catch this error: read ECONNRESET HOT 1
- Impossible to handle server errors like 'EADDRINUSE' without 'domain'
- Missing typing definition
- `fs.unlink()` is used as if it was synchronous when deleting a stale UNIX socket
- unix socket reconnect fails HOT 2
- tls certificates ? HOT 1
- Deprecated prototypical inheritance
- Is it still maintained ?
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 axon.