Compare commits
No commits in common. "b2c54ae8c04db62d32901cbca8fb2b220dce7d35" and "a8d80eaddf8784532d88442d74202a47af7de047" have entirely different histories.
b2c54ae8c0
...
a8d80eaddf
@ -1,28 +0,0 @@
|
|||||||
pipeline:
|
|
||||||
# Check moxxmpp
|
|
||||||
moxxmpp-lint:
|
|
||||||
image: dart:2.18.1
|
|
||||||
commands:
|
|
||||||
- cd packages/moxxmpp
|
|
||||||
- dart pub get
|
|
||||||
- dart analyze --fatal-infos --fatal-warnings
|
|
||||||
moxxmpp-test:
|
|
||||||
image: dart:2.18.1
|
|
||||||
commands:
|
|
||||||
- cd packages/moxxmpp
|
|
||||||
- dart pub get
|
|
||||||
- dart test
|
|
||||||
|
|
||||||
# Check moxxmpp_socket_tcp
|
|
||||||
moxxmpp_socket_tcp-lint:
|
|
||||||
image: dart:2.18.1
|
|
||||||
commands:
|
|
||||||
- cd packages/moxxmpp_socket_tcp
|
|
||||||
- dart pub get
|
|
||||||
- dart analyze --fatal-infos --fatal-warnings
|
|
||||||
# moxxmpp-test:
|
|
||||||
# image: dart:2.18.1
|
|
||||||
# commands:
|
|
||||||
# - cd packages/moxxmpp
|
|
||||||
# - dart pub get
|
|
||||||
# - dart test
|
|
@ -84,21 +84,16 @@ abstract class ReconnectionPolicy {
|
|||||||
|
|
||||||
/// A simple reconnection strategy: Make the reconnection delays exponentially longer
|
/// A simple reconnection strategy: Make the reconnection delays exponentially longer
|
||||||
/// for every failed attempt.
|
/// for every failed attempt.
|
||||||
/// NOTE: This ReconnectionPolicy may be broken
|
|
||||||
class ExponentialBackoffReconnectionPolicy extends ReconnectionPolicy {
|
class ExponentialBackoffReconnectionPolicy extends ReconnectionPolicy {
|
||||||
ExponentialBackoffReconnectionPolicy(this._maxBackoffTime) : super();
|
|
||||||
|
|
||||||
/// The maximum time in seconds that a backoff step should be.
|
ExponentialBackoffReconnectionPolicy(this._maxBackoffTime)
|
||||||
|
: _counter = 0,
|
||||||
|
_log = Logger('ExponentialBackoffReconnectionPolicy'),
|
||||||
|
super();
|
||||||
final int _maxBackoffTime;
|
final int _maxBackoffTime;
|
||||||
|
int _counter;
|
||||||
/// Amount of consecutive failed reconnections.
|
|
||||||
int _counter = 0;
|
|
||||||
|
|
||||||
/// Backoff timer.
|
|
||||||
Timer? _timer;
|
Timer? _timer;
|
||||||
|
final Logger _log;
|
||||||
/// Logger.
|
|
||||||
final Logger _log = Logger('ExponentialBackoffReconnectionPolicy');
|
|
||||||
|
|
||||||
/// Called when the backoff expired
|
/// Called when the backoff expired
|
||||||
Future<void> _onTimerElapsed() async {
|
Future<void> _onTimerElapsed() async {
|
||||||
@ -146,7 +141,7 @@ class ExponentialBackoffReconnectionPolicy extends ReconnectionPolicy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A stub reconnection policy for tests.
|
/// A stub reconnection policy for tests
|
||||||
@visibleForTesting
|
@visibleForTesting
|
||||||
class TestingReconnectionPolicy extends ReconnectionPolicy {
|
class TestingReconnectionPolicy extends ReconnectionPolicy {
|
||||||
TestingReconnectionPolicy() : super();
|
TestingReconnectionPolicy() : super();
|
||||||
|
Loading…
Reference in New Issue
Block a user