are RPCs internally synchronous?

#1

i have a javascript frontend that does the approximate of this:

sub(topic1)

sub(topic2)

sub(topic3)

sub(topic4)

call(func1)

i have a python backend that does the approximate of this:

def func1()

def a() # .1 second

do_something

publish(topic1, results)

def b() # .1 second

do_something

publish(topic2, results)

def c() # .1 second

do_something

publish(topic3, results)

def d() # takes 60 seconds

do_something

publish(topic4, results)

loop=asyncio.get_event_loop()

tasks = [a,b,c,d] # a = a(opt1, opt2, opt3)

loop.run_until_complete(tasks)

running crossbar w/ debug level (w/ appropriate @inlineCallbacks and @asyncio.coroutine decorations), i see that crossbar sees the publish data for the first three functions within about a tenth of a second from the python backend as expected. but it does not send these published results to the browser (websocket) until d() is complete and it sends all 4 results at the same time.

how do i get crossbar to send publish() results for each topic immediately instead of waiting until the func1() RPC is completed?

0 Likes

#2

i changed my browser client to do a publish() to which the backend is subscribed to, and crossbar still waits for the subscribed callback to complete before emitting any published data to the browser client.

···

On Monday, November 30, 2015 at 11:13:09 PM UTC, David Ford wrote:

i have a javascript frontend that does the approximate of this:

sub(topic1)

sub(topic2)

sub(topic3)

sub(topic4)

call(func1)

i have a python backend that does the approximate of this:

def func1()

def a() # .1 second

do_something

publish(topic1, results)

def b() # .1 second

do_something

publish(topic2, results)

def c() # .1 second

do_something

publish(topic3, results)

def d() # takes 60 seconds

do_something

publish(topic4, results)

loop=asyncio.get_event_loop()

tasks = [a,b,c,d] # a = a(opt1, opt2, opt3)

loop.run_until_complete(tasks)

running crossbar w/ debug level (w/ appropriate @inlineCallbacks and @asyncio.coroutine decorations), i see that crossbar sees the publish data for the first three functions within about a tenth of a second from the python backend as expected. but it does not send these published results to the browser (websocket) until d() is complete and it sends all 4 results at the same time.

how do i get crossbar to send publish() results for each topic immediately instead of waiting until the func1() RPC is completed?

0 Likes

#3

Hi David,

you’re asking the same question here: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/crossbario/7ucxlDgN9NU/lMu3_NKwBAAJ - so see Amber’s answer there. (And let’s have any follow-ups there as well.)

Regards,

Alex

···

Am Mittwoch, 2. Dezember 2015 00:06:54 UTC+1 schrieb David Ford:

i changed my browser client to do a publish() to which the backend is subscribed to, and crossbar still waits for the subscribed callback to complete before emitting any published data to the browser client.

On Monday, November 30, 2015 at 11:13:09 PM UTC, David Ford wrote:

i have a javascript frontend that does the approximate of this:

sub(topic1)

sub(topic2)

sub(topic3)

sub(topic4)

call(func1)

i have a python backend that does the approximate of this:

def func1()

def a() # .1 second

do_something

publish(topic1, results)

def b() # .1 second

do_something

publish(topic2, results)

def c() # .1 second

do_something

publish(topic3, results)

def d() # takes 60 seconds

do_something

publish(topic4, results)

loop=asyncio.get_event_loop()

tasks = [a,b,c,d] # a = a(opt1, opt2, opt3)

loop.run_until_complete(tasks)

running crossbar w/ debug level (w/ appropriate @inlineCallbacks and @asyncio.coroutine decorations), i see that crossbar sees the publish data for the first three functions within about a tenth of a second from the python backend as expected. but it does not send these published results to the browser (websocket) until d() is complete and it sends all 4 results at the same time.

how do i get crossbar to send publish() results for each topic immediately instead of waiting until the func1() RPC is completed?

0 Likes