wamp-protocol

Can autobahn.twisted.wamp.Application do pub/sub?

你。 提交于 2019-12-24 11:58:31
问题 I would like to use some pub/sub features along with rpc from autobahn.twisted.wamp.Application I'd prefer not to make a ApplicationSession class if I can get by without doing so. Can registered rpc methods cause client subscriptions and publish? If they can, please show me how. 回答1: Yes, sure: def onEvent(msg): print("got event: {}".format(msg)) @app.register('com.example.triggersubscribe') def triggerSubscribe(): yield app.session.subscribe(onEvent, 'com.example.topic1') When

How to send Autobahn/Twisted WAMP message from outside of protocol?

血红的双手。 提交于 2019-12-19 07:18:11
问题 I am following the basic wamp pubsub examples in the github code: This example publishes messages from within the class: class Component(ApplicationSession): """ An application component that publishes an event every second. """ def __init__(self, realm = "realm1"): ApplicationSession.__init__(self) self._realm = realm def onConnect(self): self.join(self._realm) @inlineCallbacks def onJoin(self, details): counter = 0 while True: self.publish('com.myapp.topic1', counter) counter += 1 yield

Browser client using autobahn.js can not connect to Ratchet Websocket Server

自古美人都是妖i 提交于 2019-12-11 10:33:28
问题 I'm struggling with a problem : I developed a Ratchet Web Socket Server using PHP Ratchet socketo.me My server is up and listening to port 8082 : require 'vendor/autoload.php'; $loop = React\EventLoop\Factory::create(); $pusher = new MyApp\Pusher; // Listen for the web server to make a ZeroMQ push after an ajax request $context = new React\ZMQ\Context($loop); $pull = $context->getSocket(ZMQ::SOCKET_PULL); $pull->bind('tcp://127.0.0.1:5551'); // Binding to 127.0.0.1 means the only client that

How to use Jawampa (Java WAMP implementation) to subcribe to an event

て烟熏妆下的殇ゞ 提交于 2019-12-09 13:44:24
问题 i want to use the poloniex API. https://poloniex.com/support/api/ So far i made Jawampa ( https://github.com/Matthias247/jawampa ) running with IntelliJ. My first Question is, how to login successfuly? (The Docu of Jawampa doesnt help) I got a API Key and a Secret. Which functions i have to use in the builder of Jawampa: withRealm withRoles withConnectorProvider withConnectionConfiguration withSerializations withStrictUriValidation withAuthId withAuthMethod withObjectMapper I have so far this

How to up to date poloniex orderbook via push api (WAMP protocol)

空扰寡人 提交于 2019-12-08 11:14:47
问题 I making software for scalping on poloniex.com To do this, I need to have fresh information about order book. API DOCUMENTATION said about push api. As i understand right it work like that: Use returnOrderBook (public method API) for getting snapshot Take sequence number (seq key) from responce Subscribe to push api with sequence number from snapshot Recive fresh data and make correction on snapshot data. <?php namespace Crypto\Scalper\Cli; use AppConfig; use Monolog\Logger; use Monolog

Integrate Autobahn|Python with aiohttp

半世苍凉 提交于 2019-12-08 02:49:37
问题 I'm trying to integrate an aiohttp web server into a Crossbar+Autobahn system architecture. More in detail, when the aiohttp server receive a certain API call, it has to publish a message to a Crossbar router. I've seen this example on the official repos but i've no clue on how to integrate it on my application. Ideally, i would like to be able to do this # class SampleTaskController(object): async def handle_get_request(self, request: web.Request) -> web.Response: self.publisher.publish('com

Poloniex Push WAMP API through Autobahn dropping connection to peer tcp

强颜欢笑 提交于 2019-12-06 02:19:33
问题 I tried to connect to the Push API in poloniex using python and followed the instructions on the answer here: How to connect to poloniex.com websocket api using a python library However I keep getting this error: 2017-06-25T04:07:04 dropping connection to peer tcp:104.20.13.48:443 with abort=True: WebSocket opening handshake timeout (peer did not finish the opening handshake in time) Anyone know what's going on here? I can't figure it out from online documentation. Thanks! 回答1: As per

How create a python application with two thread each which has a autobahn application

别来无恙 提交于 2019-12-05 02:07:16
问题 I have not found any solution for my problem. I need to create a python application with two thread, each of which is connected to a WAMP Router using autobahn library. Follow I write the code of my experiment: wampAddress = 'ws://172.17.3.139:8181/ws' wampRealm = 's4t' from threading import Thread from autobahn.twisted.wamp import ApplicationRunner from autobahn.twisted.wamp import ApplicationSession from twisted.internet.defer import inlineCallbacks class AutobahnMRS(ApplicationSession):

How to use Jawampa (Java WAMP implementation) to subcribe to an event

牧云@^-^@ 提交于 2019-12-03 21:34:55
i want to use the poloniex API. https://poloniex.com/support/api/ So far i made Jawampa ( https://github.com/Matthias247/jawampa ) running with IntelliJ. My first Question is, how to login successfuly? (The Docu of Jawampa doesnt help) I got a API Key and a Secret. Which functions i have to use in the builder of Jawampa: withRealm withRoles withConnectorProvider withConnectionConfiguration withSerializations withStrictUriValidation withAuthId withAuthMethod withObjectMapper I have so far this code try { WampClientBuilder builder = new WampClientBuilder(); builder.withConnectorProvider

Running several ApplicationSessions non-blockingly using autbahn.asyncio.wamp

不打扰是莪最后的温柔 提交于 2019-12-01 05:37:06
问题 I'm trying to run two autobahn.asyncio.wamp.ApplicationSession s in python at the same time. Previously, I did this using a modification of the autobahn library as suggested in this post's answer. I now require a bit more professional solution. After googling about for a while, this post appeared quite promising, but uses the twisted library, instead of asyncio . I wasn't able to identify a similar solution for the asyncio branch of the autobahn library, since it doesn't appear to be using