Concurrent requests

#1

Hello. I wanted to see how Crossbar deal with concurrent requests, so I added sleep(10); to Remote Procedure and I am experiencing weird behaviour:

  1. I send 5 same requests

  2. After 10 sec. I get first response.

  3. After 40 sec. I get four rest responses.

Moreover disabling authorizer result in following behaviour:

  1. I send 5 same requests

  2. After 50 sec. I get five responses.

Could somebody explain that? And shouldn’t my function run asynchronosly if it is non-blocking?

0 Likes

#2

Can you please post the full code snippet?

···

On Thursday, 20 July 2017 16:27:38 UTC+2, Andrzej Broński wrote:

Hello. I wanted to see how Crossbar deal with concurrent requests, so I added sleep(10); to Remote Procedure and I am experiencing weird behaviour:

  1. I send 5 same requests
  1. After 10 sec. I get first response.
  1. After 40 sec. I get four rest responses.

Moreover disabling authorizer result in following behaviour:

  1. I send 5 same requests
  1. After 50 sec. I get five responses.

Could somebody explain that? And shouldn’t my function run asynchronosly if it is non-blocking?

0 Likes

#3

pls see https://github.com/crossbario/crossbar/issues/1145#issuecomment-316997740

···

Am 20.07.2017 um 16:27 schrieb Andrzej Broński:

Hello. I wanted to see how Crossbar deal with concurrent requests, so I
added sleep(10); to Remote Procedure and I am experiencing weird behaviour:
1. I send 5 same requests
2. After 10 sec. I get first response.
3. After 40 sec. I get four rest responses.
Moreover disabling authorizer result in following behaviour:
1. I send 5 same requests
2. After 50 sec. I get five responses.
Could somebody explain that? And shouldn't my function run asynchronosly if
it is non-blocking?

0 Likes

#4

Yeah, I suspected he was using time.sleep :slight_smile:

If there's one rule when it comes to concurrency it's that it's always more complex than it seems, even in a single-threaded-by-default system :wink:

0 Likes