Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nodejitsu/godot
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: patch-branch
Choose a base ref
...
head repository: nextorigin/godot2
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: nextorigin
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.

Commits on Dec 31, 2013

  1. [refactor minor] Set producer.id in `godot.net.Client.prototype.add…

    …` so that any unmodified ReadableStream instance can be used as a godot Producer.
    indexzero committed Dec 31, 2013
    Copy the full SHA
    10d273e View commit details
  2. [dist] Minor ordering OCD. Dependencies should be: native, modules, d…

    …econstructing, relative paths (each in alphabetical order).
    indexzero committed Dec 31, 2013
    Copy the full SHA
    e42057b View commit details
  3. Merge pull request #63 from nodejitsu/refactor-id-in-client

    Refactor id in client
    jcrugzz committed Dec 31, 2013
    Copy the full SHA
    c05d931 View commit details

Commits on Apr 7, 2014

  1. remove return statement in console reactor

    Otherwise, if data isn't consumed afterwards, a `pipe`d source will be paused after the first event. 
    
    Exmplanation: `emit` returns false if the event isn't handled, `pipe` pauses the source stream when the target's `write` method returns false.
    fb55 committed Apr 7, 2014
    Copy the full SHA
    1ed7208 View commit details
  2. Merge pull request #66 from fb55/patch-1

    Remove return statement in console reactor
    jcrugzz committed Apr 7, 2014
    Copy the full SHA
    6cd192f View commit details
  3. Copy the full SHA
    d618a31 View commit details
  4. Copy the full SHA
    e5d87e2 View commit details
  5. Copy the full SHA
    ddd246b View commit details

Commits on Apr 9, 2014

  1. Copy the full SHA
    4d8751a View commit details
  2. Copy the full SHA
    3f09ff3 View commit details
  3. Copy the full SHA
    9598f09 View commit details
  4. Copy the full SHA
    e515354 View commit details
  5. Copy the full SHA
    5b8b354 View commit details
  6. [doc] add logo and attrib

    jcrugzz committed Apr 9, 2014
    Copy the full SHA
    1baa7a5 View commit details
  7. Merge pull request #67 from nodejitsu/new-api

    New api
    jcrugzz committed Apr 9, 2014
    Copy the full SHA
    eaa7646 View commit details
  8. Copy the full SHA
    2334cb1 View commit details
  9. [fix] bump window-stream

    jcrugzz committed Apr 9, 2014
    Copy the full SHA
    059d1f1 View commit details
  10. Copy the full SHA
    3ac80a0 View commit details
  11. Copy the full SHA
    f54c314 View commit details
  12. Copy the full SHA
    78687de View commit details
  13. Copy the full SHA
    e6929e2 View commit details
  14. Copy the full SHA
    41a4b9d View commit details

Commits on Aug 29, 2014

  1. Copy the full SHA
    14cf31c View commit details

Commits on Sep 9, 2014

  1. [fix] add meta to defaults

    jcrugzz committed Sep 9, 2014
    Copy the full SHA
    d485fd7 View commit details

Commits on Sep 14, 2014

  1. Copy the full SHA
    bf6ff2a View commit details

Commits on Sep 15, 2014

  1. Copy the full SHA
    0bba7a5 View commit details

Commits on Oct 11, 2014

  1. Copy the full SHA
    ec5c940 View commit details

Commits on Nov 26, 2014

  1. Copy the full SHA
    642c283 View commit details
  2. Copy the full SHA
    062dc07 View commit details

Commits on Sep 8, 2016

  1. Copy the full SHA
    5ec82a4 View commit details
  2. Copy the full SHA
    c5cf2ff View commit details
  3. [fix] add meta to defaults

    jcrugzz authored and doublerebel committed Sep 8, 2016
    Copy the full SHA
    20bdbf0 View commit details
  4. Copy the full SHA
    325e6d2 View commit details
  5. Copy the full SHA
    ed5a278 View commit details
  6. [fix] return the attempt to null if we connect so each reconnect seri…

    …es is independent
    jcrugzz authored and doublerebel committed Sep 8, 2016
    Copy the full SHA
    79bf259 View commit details
  7. Copy the full SHA
    3eb291c View commit details
  8. Copy the full SHA
    fbec69d View commit details
  9. [test fix] properly fix tests

    jcrugzz authored and doublerebel committed Sep 8, 2016
    Copy the full SHA
    4850518 View commit details
  10. Copy the full SHA
    1993f54 View commit details
  11. [cleanup] formatting

    doublerebel committed Sep 8, 2016
    Copy the full SHA
    d6e8902 View commit details
  12. Copy the full SHA
    d3d06f5 View commit details
  13. Copy the full SHA
    8e79ed5 View commit details
  14. [dist] contributors

    doublerebel committed Sep 8, 2016
    Copy the full SHA
    ba89422 View commit details
  15. Copy the full SHA
    2cb397b View commit details
  16. Copy the full SHA
    7092fec View commit details
  17. Copy the full SHA
    3fc6b22 View commit details
  18. Copy the full SHA
    8c004fa View commit details
  19. Copy the full SHA
    a56a1f0 View commit details

Commits on Sep 9, 2016

  1. Copy the full SHA
    39f5c3c View commit details
  2. Copy the full SHA
    7011f88 View commit details
Showing with 6,616 additions and 3,599 deletions.
  1. +3 −1 .gitignore
  2. +11 −0 .travis.yml
  3. +1 −1 LICENSE
  4. +111 −66 README.md
  5. +1 −1 example/client.js
  6. +6 −20 example/server.js
  7. +3 −3 lib/godot.js
  8. +0 −41 lib/godot/common/index.js
  9. +1 −1 lib/godot/common/math.js
  10. +0 −46 lib/godot/common/read-write-stream.js
  11. +325 −304 lib/godot/net/client.js
  12. +1 −1 lib/godot/net/index.js
  13. +301 −339 lib/godot/net/server.js
  14. +24 −0 lib/godot/net/socket.js
  15. +1 −1 lib/godot/producer/index.js
  16. +1 −6 lib/godot/producer/producer.js
  17. +3 −2 lib/godot/reactor/all-meta.js
  18. +3 −2 lib/godot/reactor/any-meta.js
  19. +7 −8 lib/godot/reactor/around.js
  20. +9 −6 lib/godot/reactor/by.js
  21. +2 −1 lib/godot/reactor/change.js
  22. +5 −4 lib/godot/reactor/coalesce.js
  23. +5 −4 lib/godot/reactor/combine.js
  24. +5 −3 lib/godot/reactor/console.js
  25. +4 −3 lib/godot/reactor/count.js
  26. +2 −1 lib/godot/reactor/email.js
  27. +1 −1 lib/godot/reactor/event-window.js
  28. +3 −2 lib/godot/reactor/expire.js
  29. +3 −2 lib/godot/{common → reactor}/filter-stream.js
  30. +3 −2 lib/godot/reactor/forward.js
  31. +1 −0 lib/godot/reactor/graphite.js
  32. +11 −10 lib/godot/reactor/has-meta.js
  33. +34 −71 lib/godot/reactor/index.js
  34. +2 −1 lib/godot/reactor/map.js
  35. +3 −2 lib/godot/reactor/mean.js
  36. +5 −5 lib/godot/reactor/meta.js
  37. +1 −1 lib/godot/reactor/moving-average.js
  38. +2 −1 lib/godot/reactor/over-meta.js
  39. +3 −2 lib/godot/reactor/over.js
  40. +4 −3 lib/godot/reactor/rate.js
  41. +61 −81 lib/godot/reactor/reactor.js
  42. +2 −1 lib/godot/reactor/redis.js
  43. +2 −1 lib/godot/reactor/rollup.js
  44. +2 −1 lib/godot/reactor/sms.js
  45. +3 −2 lib/godot/reactor/sum.js
  46. +5 −5 lib/godot/reactor/tag.js
  47. +3 −2 lib/godot/reactor/tagged-all.js
  48. +3 −2 lib/godot/reactor/tagged-any.js
  49. +11 −10 lib/godot/reactor/tagged.js
  50. +5 −4 lib/godot/reactor/throttle.js
  51. +1 −1 lib/godot/reactor/time-window.js
  52. +2 −1 lib/godot/reactor/under-meta.js
  53. +3 −2 lib/godot/reactor/under.js
  54. +2 −1 lib/godot/reactor/where.js
  55. +1 −1 lib/godot/reactor/window-sum.js
  56. +3 −2 lib/godot/reactor/within.js
  57. +55 −24 package.json
  58. +64 −0 src/godot.coffee
  59. +300 −0 src/godot/net/client.coffee
  60. +7 −0 src/godot/net/index.coffee
  61. +324 −0 src/godot/net/server.coffee
  62. +21 −0 src/godot/net/socket.coffee
  63. +18 −0 src/godot/producer/index.coffee
  64. +128 −0 src/godot/producer/producer.coffee
  65. +21 −0 src/godot/reactor/all-meta.coffee
  66. +21 −0 src/godot/reactor/any-meta.coffee
  67. +30 −0 src/godot/reactor/around.coffee
  68. +73 −0 src/godot/reactor/by.coffee
  69. +10 −0 src/godot/reactor/chain.coffee
  70. +54 −0 src/godot/reactor/change.coffee
  71. +42 −0 src/godot/reactor/coalesce.coffee
  72. +39 −0 src/godot/reactor/combine.coffee
  73. +32 −0 src/godot/reactor/console.coffee
  74. +59 −0 src/godot/reactor/count.coffee
  75. +89 −0 src/godot/reactor/email.coffee
  76. +6 −0 src/godot/reactor/event-window.coffee
  77. +64 −0 src/godot/reactor/expire.coffee
  78. +27 −0 src/godot/reactor/filter-stream.coffee
  79. +59 −0 src/godot/reactor/forward.coffee
  80. +86 −0 src/godot/reactor/graphite.coffee
  81. +75 −0 src/godot/reactor/has-meta.coffee
  82. +46 −0 src/godot/reactor/index.coffee
  83. +59 −0 src/godot/reactor/map.coffee
  84. +36 −0 src/godot/reactor/mean.coffee
  85. +10 −0 src/godot/reactor/merge.coffee
  86. +34 −0 src/godot/reactor/meta-split.coffee
  87. +54 −0 src/godot/reactor/meta.coffee
  88. +6 −0 src/godot/reactor/moving-average.coffee
  89. +35 −0 src/godot/reactor/over-meta.coffee
  90. +32 −0 src/godot/reactor/over.coffee
  91. +65 −0 src/godot/reactor/rate.coffee
  92. +46 −0 src/godot/reactor/reactor.coffee
  93. +75 −0 src/godot/reactor/redis-cache.coffee
  94. +52 −0 src/godot/reactor/redis.coffee
  95. +94 −0 src/godot/reactor/rollup.coffee
  96. +51 −0 src/godot/reactor/slack.coffee
  97. +72 −0 src/godot/reactor/sms.coffee
  98. +67 −0 src/godot/reactor/split.coffee
  99. +34 −0 src/godot/reactor/sum.coffee
  100. +54 −0 src/godot/reactor/tag.coffee
  101. +19 −0 src/godot/reactor/tagged-all.coffee
  102. +19 −0 src/godot/reactor/tagged-any.coffee
  103. +55 −0 src/godot/reactor/tagged.coffee
  104. +61 −0 src/godot/reactor/throttle.coffee
  105. +6 −0 src/godot/reactor/time-window.coffee
  106. +36 −0 src/godot/reactor/under-meta.coffee
  107. +32 −0 src/godot/reactor/under.coffee
  108. +116 −0 src/godot/reactor/where.coffee
  109. +6 −0 src/godot/reactor/window-sum.coffee
  110. +35 −0 src/godot/reactor/within.coffee
  111. +1 −1 test/common/math-test.js
  112. +7 −7 test/fixtures/by.json
  113. +4 −4 test/fixtures/coalesce.json
  114. +3 −3 test/fixtures/fireForget.json
  115. +3 −3 test/fixtures/from-to.json
  116. +3 −3 test/fixtures/health.json
  117. +126 −126 test/fixtures/large-dataset.json
  118. +1 −1 test/fixtures/producer-tagged.json
  119. +2 −1 test/fixtures/producer-test.json
  120. +1 −1 test/helpers/index.js
  121. +63 −0 test/helpers/net.coffee
  122. +0 −101 test/helpers/net.js
  123. +37 −0 test/helpers/reactor.coffee
  124. +0 −52 test/helpers/reactor.js
  125. +3 −3 test/helpers/run/index.js
  126. +1 −1 test/helpers/run/producer.js
  127. +15 −13 test/helpers/run/reactor.js
  128. +0 −10 test/macros/index.js
  129. +0 −255 test/macros/net.js
  130. +0 −64 test/macros/producer.js
  131. +0 −258 test/macros/reactor.js
  132. +2 −2 test/mocks/email.js
  133. +1 −1 test/mocks/index.js
  134. +1 −1 test/mocks/net.js
  135. +1 −1 test/mocks/redis.js
  136. +1 −1 test/mocks/sms.js
  137. +81 −0 test/net/client-reconnect-test.coffee
  138. +0 −115 test/net/client-reconnect-test.js
  139. +81 −0 test/net/client-test.coffee
  140. +0 −37 test/net/client-test.js
  141. +106 −0 test/net/duplex-multiple-test.coffee
  142. +0 −59 test/net/duplex-multiple-test.js
  143. +125 −0 test/net/duplex-test.coffee
  144. +0 −63 test/net/duplex-test.js
  145. +4 −4 test/net/server-test.js
  146. +9 −2 test/perf/pummel.js
  147. +100 −0 test/producer/producer-test.coffee
  148. +0 −80 test/producer/producer-test.js
  149. +105 −0 test/reactor/around-test.coffee
  150. +0 −86 test/reactor/around-test.js
  151. +94 −0 test/reactor/by-test.coffee
  152. +0 −72 test/reactor/by-test.js
  153. +56 −0 test/reactor/change-test.coffee
  154. +0 −30 test/reactor/change-test.js
  155. +52 −0 test/reactor/coalesce-test.coffee
  156. +0 −26 test/reactor/coalesce-test.js
  157. +68 −0 test/reactor/email-test.coffee
  158. +0 −44 test/reactor/email-test.js
  159. +53 −0 test/reactor/expire-test.coffee
  160. +0 −32 test/reactor/expire-test.js
  161. +63 −0 test/reactor/forward-test.coffee
  162. +0 −71 test/reactor/forward-test.js
  163. +116 −0 test/reactor/map-test.coffee
  164. +0 −65 test/reactor/map-test.js
  165. +35 −0 test/reactor/mean-test.coffee
  166. +0 −23 test/reactor/mean-test.js
  167. +278 −0 test/reactor/meta-test.coffee
  168. +0 −177 test/reactor/meta-test.js
  169. +97 −0 test/reactor/moving-average-test.coffee
  170. +0 −96 test/reactor/moving-average-test.js
  171. +38 −0 test/reactor/over-test.coffee
  172. +0 −23 test/reactor/over-test.js
  173. +40 −0 test/reactor/rate-test.coffee
  174. +0 −25 test/reactor/rate-test.js
  175. +1 −1 test/reactor/reactor-test.js
  176. +46 −0 test/reactor/redis-test.coffee
  177. +0 −29 test/reactor/redis-test.js
  178. +89 −0 test/reactor/rollup-test.coffee
  179. +0 −52 test/reactor/rollup-test.js
  180. +65 −0 test/reactor/sms-test.coffee
  181. +0 −42 test/reactor/sms-test.js
  182. +41 −0 test/reactor/sum-test.coffee
  183. +0 −23 test/reactor/sum-test.js
  184. +58 −0 test/reactor/tag-test.coffee
  185. +0 −58 test/reactor/tag-test.js
  186. +83 −0 test/reactor/tagged-test.coffee
  187. +0 −46 test/reactor/tagged-test.js
  188. +54 −0 test/reactor/throttle-test.coffee
  189. +0 −30 test/reactor/throttle-test.js
  190. +38 −0 test/reactor/under-test.coffee
  191. +0 −23 test/reactor/under-test.js
  192. +83 −0 test/reactor/where-test.coffee
  193. +0 −44 test/reactor/where-test.js
  194. +112 −0 test/reactor/window-test.coffee
  195. +0 −76 test/reactor/window-test.js
  196. +38 −0 test/reactor/within-test.coffee
  197. +0 −23 test/reactor/within-test.js
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -12,4 +12,6 @@ logs
results

npm-debug.log
node_modules/
*.sublime-project
*.sublime-workspace
coverage/
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: node_js
node_js:
- "6"
- "5"
- "4"
- "0.12"
before_script:
- "npm run build"
after_success:
- "npm run coverage-report"
- "cat ./coverage/lcov.info | ./node_modules/.bin/coveralls"
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (C) 2013 Nodejitsu Inc.
Copyright (C) 2013 Charlie Robbins, Jarrett Cruger, and the Contributors.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
177 changes: 111 additions & 66 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
# godot
# godot2

Godot is a streaming real-time event processor based on [Riemann][riemann] written in Node.js
[![Build Status][ci-nextorigin]][travis-ci]
[![Coverage Status][coverage-nextorigin]][coveralls]
[![Dependency Status][dependency]][david]
[![devDependency Status][dev-dependency]][david-dev]
[![Downloads][downloads]][npm-package]

A streaming real-time event processor based on [Riemann][riemann] written in Node.js

[![NPM][npm-stats]][npm-package]

![](https://i.cloudup.com/zCF6jLRpLf.png)

**Godot2** is a major rewrite for Node 6 and Streams2/Streams3 syntax, similar to as suggested in [nodejitsu/godot#64](https://github.com/nodejitsu/godot/issues/64). The async patterns and inheritance are simplified with Iced CoffeeScript.

Many thanks and much credit to the original authors at Nodejitsu, [@indexzero](https://github.com/indexzero) and [@jcrugzz](https://github.com/jcrugzz).

* [Usage](#usage)
* [Events](#events)
@@ -14,77 +28,84 @@ Godot is a streaming real-time event processor based on [Riemann][riemann] writt
Here is a simple example of a [Reactor](#reactors) server that will send an email to `user@host.com` if the [Producer](#producer) server for `app.server` fails to send a heartbeat after 60 seconds.

``` js
var godot = require('../lib/godot');
var godot = require('godot2'),
chain = godot.dsl.chain,
where = godot.dsl.where,
expire = godot.dsl.expire,
email = godot.dsl.email;

//
// Reactor server which will email `user@host.com`
// whenever any service matching /.*\/health\/heartbeat/
// fails to check in after 60 seconds.
//
godot.createServer({
//
// Reactor server which will email `user@host.com`
// whenever any service matching /.*\/health\/heartbeat/
// fails to check in after 60 seconds.
// Defaults to UDP
//
godot.createServer({
//
// Defaults to UDP
//
type: 'udp',
reactors: [
godot.reactor()
.where('service', '*/health/heartbeat')
.expire(1000 * 60)
.email({ to: 'user@host.com' })
]
}).listen(1337);
type: 'udp',
reactors: [
chain([
where('service', '*/health/heartbeat'),
expire(1000 * 60),
email({ to: 'user@host.com' })
])
]
}).listen(1337);

//
// Producer client which sends events for the service
// `app.server/health/heartbeat` every 15 seconds.
//
godot.createClient({
//
// Producer client which sends events for the service
// `app.server/health/heartbeat` every 15 seconds.
// Defaults to UDP
//
godot.createClient({
//
// Defaults to UDP
//
type: 'udp',
producers: [
godot.producer({
host: 'app.server.com',
service: 'app.server/health/heartbeat',
ttl: 1000 * 15
})
],
//
// Add Reconnect logic that uses `back`
//
reconnect: {
retries: 2,
minDelay: 100,
maxDelay: 300
}
}).connect(1337);
type: 'udp',
producers: [
godot.producer({
host: 'app.server.com',
service: 'app.server/health/heartbeat',
ttl: 1000 * 15
})
],
//
// Add Reconnect logic that uses `back`
//
reconnect: {
retries: 2,
minDelay: 100,
maxDelay: 300
}
}).connect(1337);
```

## Events
Similar to [Riemann][riemann], events in `godot` are simply JSON sent over UDP or TCP. Each event has these optional fields:

``` js
{
host: "A hostname, e.g. 'api1', 'foo.com'"
service: "e.g. 'API port 8000 reqs/sec'",
state: "Any string less than 255 bytes, e.g. 'ok', 'warning', 'critical'",
time: "The time of the event, in unix epoch seconds",
description: "Freeform text",
tags: "Freeform list of strings, e.g. ['rate', 'fooproduct', 'transient']",
meta: "Freeform set of key:value pairs e.g. { 'ewma': 12345 }",
metric: "A number associated with this event, e.g. the number of reqs/sec.",
ttl: "A floating-point time, in seconds, that this event is considered valid for."
}
{
host: "A hostname, e.g. 'api1', 'foo.com'"
service: "e.g. 'API port 8000 reqs/sec'",
state: "Any string less than 255 bytes, e.g. 'ok', 'warning', 'critical'",
time: "The time of the event, in unix epoch seconds",
description: "Freeform text",
tags: "Freeform list of strings, e.g. ['rate', 'fooproduct', 'transient']",
meta: "Freeform set of key:value pairs e.g. { 'ewma': 12345 }",
metric: "A number associated with this event, e.g. the number of reqs/sec.",
ttl: "A floating-point time, in seconds, that this event is considered valid for."
}
```

## Reactors
Reactors in Godot are **readable and writable** [Stream][stream] instances which consume [Events](#events) and produce actions or aggregate data flow.
Reactors in Godot are **readable and writable** [Stream][stream] instances which consume [Events](#events) and produce actions or aggregate data flow. In the example above you may see that when we define the array of reactors by wrapping it with a simple function. This function has a single argument that represents the data coming over the wire. This data can be piped to any `godot` stream or any Transform stream you find on NPM!

### Primitives

There are several core Reactor primitives available in `godot` which can be composed to create more complex behavior:

**NOTE: This list is outdated and incomplete, see [`/src/godot/reactor`](https://github.com/nextorigin/godot2/tree/nextorigin/src/godot/reactor) for the complete list.**

* `.aggregate()`: Aggregates `metric` property on events
* `.change(key {from: x, to: y})`: Emits events when the key is changed, accepts optional `from` and `to` options for more specific changes.
* `.email(options)`: Sends an email to the specified [options][email-options].
@@ -98,44 +119,68 @@ There are several core Reactor primitives available in `godot` which can be comp
Here are two possible rollup examples:

```js
var godot = require('godot2'),
chain = godot.dsl.chain,
rollup = godot.dsl.rollup,
email = godot.dsl.email;

//
// Rolls up 10,0000 events every 5 minute interval
// then sends them in an email
//
var rollup =
reactor()
.rollup(1000 * 60 * 5, 10000)
var rollup = chain([
rollup(1000 * 60 * 5, 10000),
email({ to: 'me@nodejitsu.com' })
]);

//
// Scaling Rollup, rolls up 10,000 events every 5min interval for 1 hour,
// then rolls up 10,000 events every 30mins
// then rolls up 10,000 events every 30mins and emails them out
//

var scalingRollup =
reactor()
.rollup(function (period) {
var scalingRollup = chain([
rollup(function (period) {
if(period < 12) {
return 1000 * 60 * 5;
}
return 1000 * 60 * 30;
}, 10000)
}, 10000),
email({ to: 'me@nodejitsu.com' })
]);
```

## Producers
Producers in Godot are **readable** [Stream][stream] instances which produce [Events](#events). Events will be emitted by a given Producer every `ttl` milliseconds.

## Tests

All tests are written in [vows][vows] and can be run with [npm][npm]:
All tests are written in [mocha][mocha] and can be run with [npm][npm]:

```sh
npm test
```
npm test
```

#### Copyright (C) 2012. Nodejitsu Inc.
#### Copyright (C) 2012. Charlie Robbins, Jarrett Cruger, and the Contributors.
#### License: MIT

_Sound Wave designed by Alessandro Suraci from the thenounproject.com_

[riemann]: http://aphyr.github.com/riemann/
[stream]: http://nodejs.org/api/stream.html
[email-options]: https://github.com/nodejitsu/godot/tree/master/lib/godot/reactor/email.js
[sms-options]: https://github.com/nodejitsu/godot/blob/master/lib/godot/reactor/sms.js
[npm]: https://npmjs.org
[vows]: http://vowsjs.org/
[mocha]: http://mochajs.org/


[ci-nextorigin]: https://img.shields.io/travis/nextorigin/godot2/nextorigin.svg?style=flat-square
[travis-ci]: https://travis-ci.org/nextorigin/godot2
[coverage-nextorigin]: https://img.shields.io/coveralls/nextorigin/godot2/nextorigin.svg?style=flat-square
[coveralls]: https://coveralls.io/r/nextorigin/godot2
[dependency]: https://img.shields.io/david/nextorigin/godot2.svg?style=flat-square
[david]: https://david-dm.org/nextorigin/godot2
[dev-dependency]: https://img.shields.io/david/dev/nextorigin/godot2.svg?style=flat-square
[david-dev]: https://david-dm.org/nextorigin/godot2?type=dev
[downloads]: https://img.shields.io/npm/dm/godot2.svg?style=flat-square
[npm-package]: https://www.npmjs.org/package/godot2
[npm-stats]: https://nodei.co/npm/godot2.png?downloads=true&downloadRank=true&stars=true
2 changes: 1 addition & 1 deletion example/client.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* client.js :: A client example showing 2 generic producers
*
* (C) 2013 Nodejitsu Inc.
* (C) 2013, Charlie Robbins, Jarrett Cruger, and the Contributors.
*
*/

26 changes: 6 additions & 20 deletions example/server.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,12 @@
/*
* server.js :: An example server with fun reactor things happening
*
* (C) 2013 Nodejits Inc.
*
*/

var godot = require('../lib/godot'),
expire = godot.reactor().expire(5000);
var g = require('../');

//
// This example shows a way to meausre two separate clients on the same
// `reactor` using the power of the `by` reactor. It will create a new reactor
// pipe-chain for each different 'service' in this case to easily assess the
// expiration of two separate `producers`.
//
godot.createServer({
g.createServer({
type: 'tcp',
reactors: [
godot.reactor()
.by('service',
expire
.console()
)
function (socket) {
socket
.pipe(new g.console())
}
]
}).listen(1337);
6 changes: 3 additions & 3 deletions lib/godot.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* godot.js: Top-level include for the `godot` module.
*
* (C) 2012, Nodejitsu Inc.
* (C) 2012, Charlie Robbins, Jarrett Cruger, and the Contributors.
*
*/

@@ -17,7 +17,7 @@ exports.net = require('./godot/net');
// Expose `reactor` module for processing and
// reacting to events.
//
exports.reactor = require('./godot/reactor');
require('./godot/reactor')(exports);

//
// ### @producer {Object}
@@ -68,4 +68,4 @@ exports.createClient = function (options) {
options.type = options.type || 'udp';

return new exports.net.Client(options);
};
};
41 changes: 0 additions & 41 deletions lib/godot/common/index.js

This file was deleted.

2 changes: 1 addition & 1 deletion lib/godot/common/math.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* math.js: Simple math functions for godot windows.
*
* (C) 2012, Nodejitsu Inc.
* (C) 2012, Charlie Robbins, Jarrett Cruger, and the Contributors.
*
*/

Loading