You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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..
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.
varg=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..
varg=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: [functionhealth(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!
The text was updated successfully, but these errors were encountered:
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 ingodot
for all ourreactors
. Currently we are able to setup a reactor pipe-chain as follows..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 thegodot
object itself.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..
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!The text was updated successfully, but these errors were encountered: