Permalink
Browse files

Added note about libgmp dependency from the bigint repo. Added a litt…

…le js highlighting too.
  • Loading branch information...
1 parent 3acd161 commit 61abc9f9296f716d456ea76076e785f27edefac4 @hamtie hamtie committed Mar 14, 2012
Showing with 18 additions and 0 deletions.
  1. +18 −0 README.md
View
@@ -2,6 +2,17 @@ Kafka javascript API
-----------------------
Interact with [Kafka](http://sna-projects.com/kafka/), LinkedIn's disk based message queue.
+Dependencies
+------------
+You'll need the libgmp source to compile this package. Under Debian-based systems,
+
+ sudo aptitude install libgmp3-dev
+
+On a Mac with [Homebrew](https://github.com/mxcl/homebrew/),
+
+ brew install gmp
+
+
Get up and running
------------------
@@ -13,6 +24,7 @@ Get up and running
3 Publish and consume some messages!
+``` js
var kafka = require('kafka')
new kafka.Consumer().connect().subscribeTopic('test').on('message', function(topic, message) {
@@ -23,12 +35,14 @@ Get up and running
producer.send("hey!")
producer.close()
})
+```
API
---
`kafka.Consumer`
+``` js
var consumer = new kafka.Consumer({
// these are the default values
host: 'localhost',
@@ -42,9 +56,12 @@ API
consumer.connect(function() {
consumer.subscribeTopic({name: 'test', partition: 0})
})
+```
+
`kafka.Producer`
+``` js
var producer = new kafka.Producer({
// these are also the default values
host: 'localhost',
@@ -55,3 +72,4 @@ API
producer.connect(function() {
producer.send('message bytes')
})
+```

0 comments on commit 61abc9f

Please sign in to comment.