We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
Any example of handling the client timeout?? and also can we set the timeout length manually??
Thanks.
The text was updated successfully, but these errors were encountered:
I use this code after send and create listener consumer:
` String amqpMessageResponse; StreamSubscription streamSubscriptionMessage; Duration timeout = new Duration(seconds: 10);
streamSubscriptionMessage = consumerForListen.listen( (AmqpMessage amqpMessage) { print('consumerForListen -> onMessage, amqpMessage: ' + amqpMessage.payloadAsString); }, ); print('start listen'); waitingForMessage = true; int counter = 0; int waitingMillisec = 0; do { print('listen counter: ' + counter.toString()); streamSubscriptionMessage.onData((amqpMessage) { try { print('streamSubscriptionMessage -> onData, amqpMessage: ' + amqpMessage.payloadAsString); } catch (e) {} if (amqpMessage.payloadAsString == 'Test') { amqpMessageResponse = amqpMessage.payloadAsString; waitingForMessage = false; } }); if (waitingForMessage) { await Future.delayed(const Duration(milliseconds: 500)); waitingMillisec += 500; if (waitingMillisec > timeout.inMilliseconds) { waitingForMessage = false; } } counter++; } while (waitingForMessage);` try{ await streamSubscriptionMessage.cancel(); } catch(e){ }
Sorry, something went wrong.
No branches or pull requests
Hi,
Any example of handling the client timeout?? and also can we set the timeout length manually??
Thanks.
The text was updated successfully, but these errors were encountered: