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. Existing code needs no changes.
Installation
[]
= "0.3.8"
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. This is the default policy used by ferogram.
use AutoSleep;
use Duration;
let policy = AutoSleep ;
NoRetries
Propagates every error immediately without sleeping.
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;
// Trip after 5 consecutive errors, stay open for 30s
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