Code Monkey home page Code Monkey logo

godot's People

Contributors

dscape avatar edef1c avatar indexzero avatar jcrugzz avatar mmalecki avatar obazoud avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

godot's Issues

godot needs a new API

What has always been my favorite part of godot is its use of streams. Transform, "read-write" or "through" streams are the best mechanism for assessing data on the fly and we use them heavily in godot for all our reactors. Currently we are able to setup a reactor pipe-chain as follows..

var g = require('godot');

var pipeChain = 
  g.reactor()
    .where('service', '*/health/heartbeat')
    .expire(1000 * 60)
    .email({ to: '[email protected]' })

Now even though this provides a simple and clean api, it hides the fact that we are using native node streams and also restricts users to the transform streams that we have available as reactors. We want to expose the raw unifying interface that native streams provide to allow you to have greater control over your event processing!

With this goal in mind, we have a couple api possibilities based on my discussion with @indexzero. Both will allow the use of the native node .pipe() method for creating custom pipe chains, allowing you to use any object based transform stream available in npm!

The other change that you will notice is that we will expose all of the native godot reactor streams on the godot object itself.

var g = require('godot');

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

So the first api is the most ideal IMO. All you need to do is pass your own custom pipe chain(s) into the reactors array and voila!

The other API is as follows..

var g = require('godot');

//
// Reactor server which will email `[email protected]`
// whenever any service matching /.*\/health\/heartbeat/
// fails to check in after 60 seconds.
//
g.createServer({
  //
  // Defaults to UDP
  //
  type: 'udp',
  reactors: [
    function health(socket) {
      socket.
       .pipe(g.where('service', '*/health/heartbeat'))
       .pipe(g.expire(1000 * 60))
       .pipe(g.email({ to: '[email protected]' }));
    }
  ]
}).listen(1337);

Now even though I like the first API better, It may not be possible to preserve the multiplexing functionality of godot where you are able to create a separate stream for each incoming connection. This API should ensure this is possible.

Now this is just the beginning of the road to godot v1.0. Please post any questions or concerns if you have any!

Error on godot createServer?

Just want to try a little bit on godot and follow readme guideline, but it will always throw error during createServer?

/home/ferrari/Programming/nodejs/nodejs-experiment/node_modules/godot/lib/godot/net/server.js:148
throw err;
^
undefined

https://github.com/nodejitsu/godot/blob/master/lib/godot/net/server.js#L134-L150
When it create server and listen, will go into this function, but responded is false and it will always throw error in the end, is this correct? Or just I use the wrong way to create godot server? thanks

.diff()

Emits the difference of the number of events between two keys on given data objects.

client.close() does not clear producer intervals

Hello,
first of all I wish to thank you for this great module: I have been using it since its publication.
Unfortunately I have the following issue while closing a udp client: it seems that producer intervals are not cleared preventing server closing.
I am creating a new client and it's producer as per code below:

var godotProducer = godot.producer({
        host: '127.0.0.1',
        service: 'heartbeat',
        ttl: 1000 * 15,
}),

var godotClient = godot.createClient({
        type: 'udp',        
});

godotClient.add(godotProducer); 

godotClient.connect(10002); 

Then, if I do not run the following clearInterval instruction before closing godot's client connection, my tcp server won't close:

clearInterval(godotProducer.ttlId);

godotClient.close();

Many thanks in advance

Change primitive should be more robust.

Right now something like:

  var godot = require('godot');

  godot.createServer({
    reactors: [
      godot.reactor()
        .change('state')
    ]
  });

Can only listen when the state property on data changes, but not when it changes from one specific value to another

Version 1.0

We are close to a 1.0 for godot. These issues need to be addressed and 1.0.0 will only work on node > 0.10.0 because of streams2

Binaries

Need binaries for something like:

  godot-server --config /path/to/godot-config-file
  godot-client --config /path/to/godot-config-file

Producer event emiting

Hi there,
I've been trying some tests with Godot, while it's really handy to get it working with the standard examples (heartbeat case), I could not find any mention of customized events sent by a Godot producer.

Moar docs branch is helpful but lacks references in this domain, whereas the godot introducing entry on Nodejistu mention the ('service', 'cpu').

Could you please paste here some quick draft example ?
I could then try to fill the documentation, if you guys do not have time for now.

Many thanks

Test Email and SMS

No tests for this. Unsure the best way to ensure delivery in tests. Could mock, but that seems counter-productive.

Do we want buffering?

Currently the setting is to drop any messages that are written to the client before it connects. This currently works for my use cases but it could be advantageous to buffer these messages to be sent in batch once the client does connect.

Thoughts?

Add a reactor::error event

This should be emitted internally by reactors. This will solve #57 and provide enable the error event to signify fatal errors.

Rollup Reactor

Another Riemann feature that seems sane / useful:

rollup will allow a few events to pass through readily. Then it starts to accumulate events,
rolling them up into a list which is submitted at the end of a given time interval.

See Rieman Docs for more info

Scaling rollup

Rollup timeout should be configurable based on the interval number.

e.g.

  • Rollup 10,000 events every 5 minutes for an hour.
  • After that Rollup 10,000 events every 30min from then on.

Error propagation can stall stream

So in the simple case the error propagation works as expected as shown in the map error tests and the macro that does the heavy lifting.

Now I believe the core problem exists with how we set up the reactor pipe-chain but I believe that will be a problem assessed in bringing godot to v1.0.0.

Anyways, somehow when there is an influx of errors being emitted from a reactor primitive, the stream is stalled and can no longer accept anymore events. I think the best approach to take is to do some dtrace testing on how the bottleneck is created underneath the hood.

How its supposed to behave is the error handlers here are placed to propagate the reactor's errors to the reactor instance to then be handled by the server instance.

Replace `node-backoff` with a simpler module, `back`

Did some live testing for #55 and found the blocking issue I think. The module itself is throwing an error when attempting to run a backoff. Easiest solution is to replace this with a simpler module back.

/node_modules/godot/node_modules/backoff/lib/backoff.js:50
        throw new Error('Backoff in progress.');
              ^
Error: Backoff in progress.
    at Backoff.backoff (/node_modules/godot/node_modules/backoff/lib/backoff.js:50:15)
    at Socket.onError (/node_modules/godot/lib/godot/net/client.js:177:44)
    at Socket.EventEmitter.emit (events.js:95:17)
    at onwriteError (_stream_writable.js:233:10)
    at onwrite (_stream_writable.js:251:5)
    at WritableState.onwrite (_stream_writable.js:97:5)
    at fireErrorCallbacks (net.js:438:13)
    at Socket._destroy (net.js:449:5)
    at Socket._write (net.js:635:10)
    at doWrite (_stream_writable.js:221:10)

.connect(callback) fails

Argument type checking always expects a port even though we say it's optional. Workaround:

client.connect(port, callback);

Streaming JSON parsing

godot emits \n delimited JSON. There are so many streaming JSON parsers out there I'm unsure which one actually handles this.

More Duplex Test Cases

Would like to see a list of actual test cases before we dig into writing them more:

Right now the one that really needs to be implemented is:

  • Expired TTL.

Is this project still alive ?

Hey guys i have seen that the last commit was basically 6 years ago but i am curios if there is at least someone who takes care of some issues or maybe maintaining the project ?

Add License

The blog post indicates this project is available under the MIT license. However, I can't find any license information in the code itself, other than Copyright Nodejitsu Inc.

Could you add an explicit LICENSE file to the repo?

"Where" Tagged Reactor

Riemann has a short-hand stream processor called "Tagged". This is like .where() except that it only checks to see if the event has a given tag.

streams2

We are going to need to do a non-trivial refactor for streams2 when it's ready, but we should not wait for [email protected]

Implement Debouncing

This is a cross-cutting concern across most Reactor primitives. When things start to go wrong it is likely for a lot of reactors to fire at once. This is likely to be a flood of email and SMS

So debouncing would only send these messages after a certain amount of time has passed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.