mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 19:59:05 +01:00
Poll less frequently when own hidden service is stable.
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
package org.briarproject.bramble.api.plugin;
|
||||
|
||||
import org.briarproject.bramble.api.event.EventBus;
|
||||
|
||||
public interface BackoffFactory {
|
||||
|
||||
Backoff createBackoff(int minInterval, int maxInterval,
|
||||
double base);
|
||||
Backoff createBackoff(EventBus eventBus, TransportId transportId,
|
||||
int minInterval, int maxInterval, double base);
|
||||
}
|
||||
|
||||
@@ -56,4 +56,9 @@ public interface PluginCallback extends ConnectionHandler {
|
||||
* This method can safely be called while holding a lock.
|
||||
*/
|
||||
void pluginStateChanged(State state);
|
||||
|
||||
/**
|
||||
* Informs the callback that the plugin's polling interval has decreased.
|
||||
*/
|
||||
void pollingIntervalDecreased();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package org.briarproject.bramble.api.plugin.event;
|
||||
|
||||
import org.briarproject.bramble.api.event.Event;
|
||||
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
|
||||
import org.briarproject.bramble.api.plugin.TransportId;
|
||||
|
||||
import javax.annotation.concurrent.Immutable;
|
||||
|
||||
/**
|
||||
* An event that is broadcast when a plugin's polling interval decreases.
|
||||
*/
|
||||
@Immutable
|
||||
@NotNullByDefault
|
||||
public class PollingIntervalDecreasedEvent extends Event {
|
||||
|
||||
private final TransportId transportId;
|
||||
|
||||
public PollingIntervalDecreasedEvent(TransportId transportId) {
|
||||
this.transportId = transportId;
|
||||
}
|
||||
|
||||
public TransportId getTransportId() {
|
||||
return transportId;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user