ferogram-mtsender
MTProto sender pool and retry policy for ferogram.
Manages DC connections and drives the retry loop for RPC calls. ferogram sits on top of this; most users never touch it directly.
ferogram re-exports the retry types. For installation instructions see the ferogram README.
What it does
DcPool: oneDcConnectionper DC, created on demandDcConnection: owns the sender loop for a single DC- Retry policy trait with built-in
AutoSleep,NoRetries, andCircuitBreaker FLOOD_WAITandSLOWMODE_WAITauto-sleep with jitter- Exponential backoff for transient I/O errors
Retry policies
AutoSleep
Sleeps on FLOOD_WAIT and retries once on I/O errors. Default policy used by ferogram.
use AutoSleep;
use Duration;
let policy = AutoSleep ;
NoRetries
Propagates every error immediately.
use NoRetries;
let policy = NoRetries;
CircuitBreaker
Trips after a set number of consecutive failures and stays open for a cooldown window.
use CircuitBreaker;
use Duration;
let policy = new;
Custom policy
use ;
use ControlFlow;
use Duration;
;
Stack position
ferogram
└ ferogram-mtsender <-- here
└ ferogram-connect
License
MIT or Apache-2.0, at your option. See LICENSE-MIT and LICENSE-APACHE.
Ankit Chaubey - github.com/ankit-chaubey