-
Support polling on multiple streams in one command to avoid having a TCP connection per stream (similar to BLPOP) Potentially, this list could be very long, e.g. a distributed chat server where each stream represents a chat log.
-
Support compaction similar to what's done in Kafka, with the current design there's currently no way to do that AFAIK.
-
TREAD's GROUP feature is a very simple compared to Kafka consumer groups and will suit many cases. What it doesn't guarantee that messages with the same key will be sent to the same consumer in the group. This prevents consumers from being able to run fast distributed stateful aggregations like count / groupby.
This file contains 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 re | |
import itertools | |
import logging | |
from apscheduler.triggers.cron import CronTrigger | |
from tornado.ioloop import IOLoop | |
from datetime import datetime | |
class CronCallback(object): | |
"""Schedules the given callback to be called periodically. |
This file contains 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
from tornado.ioloop import IOLoop | |
from tornado.iostream import IOStream | |
from tornado.netutil import TCPServer | |
from tornado.gen import engine, Task | |
from tornado.util import b | |
import socket | |
import time | |
import sys |
This file contains 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
from tornado.util import b | |
import socket | |
import sys | |
MB = 0x100000 | |
dlen = 5 * MB | |
data = b("A") * dlen + "\r\n" | |
port = 16661 | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0) |
This file contains 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 os | |
import pika | |
from time import sleep | |
from subprocess import check_call, call, check_output | |
from pika.spec import PORT as DEFAULT_PORT | |
from pika.reconnection_strategies import SimpleReconnectionStrategy | |
#from pika.adapters.select_connection import SelectConnection as Connection | |
from pika.adapters.tornado_connection import TornadoConnection as Connection |
This file contains 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 | |
while True: | |
l = raw_input() | |
sys.stdout.write(l+"\n") | |
sys.stdout.flush() |
This file contains 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 motor | |
import toro | |
import time | |
import logging | |
from tornado import ioloop, gen | |
def sleep(seconds, io_loop = None): | |
io_loop = io_loop or ioloop.IOLoop.instance() | |
return gen.Task(io_loop.add_timeout, time.time() + seconds) |
This file contains 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 functools | |
import termios | |
import socket | |
from tornado import gen, ioloop, iostream | |
from datetime import timedelta | |
class StdinReader(object): |
This file contains 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
const path = require('path'); | |
const fs = require('fs'); | |
const grpc = require('@grpc/grpc-js'); // No error if replaced with grpc | |
const Client = grpc.makeGenericClientConstructor({}, 'WorkflowService', {}); | |
const credentials = grpc.credentials.createSsl( | |
fs.readFileSync(path.join(__dirname, 'certs/cluster/ca/server-intermediate-ca.pem')), | |
fs.readFileSync(path.join(__dirname, 'certs/client/development/client-development-namespace.key')), | |
fs.readFileSync(path.join(__dirname, 'certs/client/development/client-development-namespace.pem')) |