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 time | |
import zmq | |
ctx = zmq.Context() | |
pub_sock = ctx.socket(zmq.PUB) | |
pub_sock.rcvhwm = 0 | |
pub_sock.bind('ipc://pub') | |
sub_sock = ctx.socket(zmq.SUB) |
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
<?php | |
// composer require fanout/gripcontrol | |
require 'vendor/fanout/pubcontrol/fanout/php-pubcontrol/src/format.php'; | |
require 'vendor/fanout/pubcontrol/fanout/php-pubcontrol/src/item.php'; | |
require 'vendor/fanout/pubcontrol/fanout/php-pubcontrol/src/pubcontrolclient.php'; | |
require 'vendor/fanout/pubcontrol/fanout/php-pubcontrol/src/pubcontrol.php'; | |
require 'vendor/fanout/gripcontrol/fanout/php-gripcontrol/src/encoding.php'; | |
require 'vendor/fanout/gripcontrol/fanout/php-gripcontrol/src/httpstreamformat.php'; |
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 rest_framework.parsers import BaseParser | |
class WebSocketContextParser(BaseParser): | |
media_type = 'application/websocket-events' | |
def parse(self, stream, media_type=None, parser_context=None): | |
assert(parser_context['request'].wscontext) | |
return '' |