Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Commit

Permalink
README updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stéphan Kochen committed Oct 22, 2010
1 parent 4c59a23 commit e66ddbb
Showing 1 changed file with 29 additions and 20 deletions.
49 changes: 29 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
**This is alpha quality. Proceed with caution**
=======================

This library allows you to access zeromq from node.js.
This library gives you experimental bindings to ØMQ from node.js.

Dependencies
============

* [node.js]. Should work with 2.0 or newer.
* [zeromq]. Build and install from the master branch. (2.0.9 is inadequate.)
Some bleeding edge dependencies are required:

* [node.js]. Should work with at least 0.3.
* [ØMQ]. Should work with at least 2.1.

At the time of writing, neither have been released. You'll have to build these
from their github repositories.

NOTE: For now, this also requires a patch to node.js.
See the [node.js zero-copy branch]. Will hopefully see this merged soon.

To Build
========
Expand All @@ -17,10 +25,10 @@ To Build
API
===

The API contains elements of the [zeromq API][zmq-api]. You should refer to it
The API contains elements of the [ØMQ API]. You should refer to it
for in depth detail of the expected behaviors of the system. These methods will
never return error codes, but may throw an exception if any of the errors
described in the zeromq documentation occur.
described in the ØMQ documentation occur.

First, include the module:

Expand All @@ -30,23 +38,23 @@ After that, you can create sockets with:

socket = zeromq.createSocket('req');

zeromq.Socket
Using ØMQ sockets
-------------
A socket is where the action happens. You can send and receive things and it is
oh such fun.

#### Constructor - `function(type)`
* type - A string describing the type of socket. You can read about the
different socket types [here][zmq-socket]. The name you use here matches the
different socket types [here][zmq_socket]. The name you use here matches the
names of the `ZMQ_*` constants, sans the `ZMQ_` prefix.

#### Methods
* connect(address) - Connect to another socket. `address` should be a string
as described in the [zeromq api docs][zmq-connect]. This method is not
asynchronous because it is non-blocking. ZeroMQ will use the provided
address when it's necessary and will not block here.
as described in the [ØMQ API docs][zmq_connect]. This method is not
asynchronous because it is non-blocking. ØMQ will use the provided address
when it's necessary and will not block here.
* bind(address, callback) - Bind to a socket to wait for incoming data.
`address` should be a string as described in the [zeromq api docs][zmq-bind].
`address` should be a string as described in the [ØMQ API docs][zmq_bind].
`callback` will be called when binding is complete and takes one argument,
a string describing any errors.
* send(message) - `message` is a string to send across the wire. The message is
Expand All @@ -71,17 +79,18 @@ Tests are pretty incomplete right now, but to run what's there:
$ node examples/simple-server.js
# in another terminal:
$ npm install vows
$ vows tests/*
$ vows

Licensing
=========

Licensed under the very permissive [MIT License][mit-license]
Licensed under the very permissive [MIT License].

[node.js]: http://nodejs.org/
[zeromq]: http://github.com/zeromq/zeromq2
[zmq-api]: http://api.zeromq.org/
[zmq-socket]: http://api.zeromq.org/zmq_socket.html
[zmq-connect]: http://api.zeromq.org/zmq_connect.html
[zmq-bind]: http://api.zeromq.org/zmq_bind.html
[mit-license]: http://www.opensource.org/licenses/mit-license.php
[node.js]: http://github.com/ry/node
[node.js zero-copy branch]: http://github.com/stephank/node/tree/zero-copy
[ØMQ]: http://github.com/zeromq/zeromq2
[ØMQ API]: http://api.zeromq.org/
[zmq_socket]: http://api.zeromq.org/zmq_socket.html
[zmq_connect]: http://api.zeromq.org/zmq_connect.html
[zmq_bind]: http://api.zeromq.org/zmq_bind.html
[MIT license]: http://www.opensource.org/licenses/mit-license.php

0 comments on commit e66ddbb

Please sign in to comment.