This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import time | |
| import zmq | |
| from multiprocessing import Process | |
| def ventilator(): | |
| # Initialize a zeromq context | |
| context = zmq.Context() | |
| # Set up a channel to send work |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import eventlet | |
| from eventlet.green import socket | |
| import zmq | |
| import sys | |
| PORT=3001 | |
| def read_socket(writer, reader): | |
| line = reader.readline() | |
| while line: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var zmq = require('zmq'); | |
| // SUBSCRIBER | |
| subsock = zmq.socket('sub'); | |
| subsock.connect ('ipc:///tmp/node.ipc'); | |
| subsock.subscribe('HELLOWORLD:'); | |
| console.log('Subscriber connected to ipc:///tmp/node.ipc'); | |
| subsock.on('message', function(msg) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var zmq = require('zmq'), sock = zmq.socket('sub'); | |
| sock.subscribe(""); | |
| sock.bindSync ('ipc:///tmp/meatcounter.ipc'); | |
| sock.on('message', function(msg) { | |
| console.log('RECEIVED: %s', msg.toString()); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <zmq.h> | |
| #include <czmq.h> | |
| #include "include/dbg.h" | |
| #define DEBUG 1 | |
| int | |
| main (void) | |
| { | |
| void *ctx = zmq_ctx_new (); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| client.On("connect", func(ns *socketio.NameSpace) { | |
| log.Println("connected") | |
| ns.Emit("ping", nil) | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| select | |
| date_trunc ('day', interval) as meatdate, | |
| topic, | |
| sum(total) as total, | |
| hll_cardinality(hll_union_agg(users)) as uniques | |
| from | |
| daily_stats | |
| where | |
| topic in ('meatspace.incoming', 'meatspace.outgoing') | |
| group by |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "log" | |
| "github.com/howeyc/fsnotify" | |
| ) | |
| func SetWatch(dir string, ce chan *fsnotify.FileEvent) { | |
| watcher, err := fsnotify.NewWatcher() | |
| if err != nil { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "log" | |
| "github.com/howeyc/fsnotify" | |
| ) | |
| func SetWatch(dir string, ce chan *fsnotify.FileEvent) { | |
| watcher, err := fsnotify.NewWatcher() | |
| if err != nil { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func main() { | |
| evChan := make(chan *fsnotify.FileEvent) | |
| lnChan := make(chan *tail.Line) | |
| done := make(chan string) | |
| conf := new(Config) | |
| err := conf.LoadConf("./goforward.json") | |
| if err != nil { | |
| log.Fatal(err) | |
| } |