pub struct SenderPool {
pub runner: SenderPoolRunner,
pub handle: SenderPoolFatHandle,
pub updates: UnboundedReceiver<UpdatesLike>,
}Expand description
Builder to configure the runner to drive I/O and linked handles.
Fields§
§runner: SenderPoolRunnerThe single mutable instance responsible for driving I/O.
Connections are created on-demand, so any errors while the pool
is running can only be retrieved with one of the SenderPool::handles.
handle: SenderPoolFatHandleStarting fat handle attached to the SenderPool::runner.
Handles are the only way to interact with the runner once it’s running.
updates: UnboundedReceiver<UpdatesLike>The single mutable channel through which updates received
from the network by the SenderPool::runner are delivered.
Update handling must be processed in a sequential manner, so this is a separate instance with no way to clone it.
Implementations§
Source§impl SenderPool
impl SenderPool
Sourcepub fn new<S>(session: Arc<S>, api_id: i32) -> SenderPoolwhere
S: Session + 'static,
pub fn new<S>(session: Arc<S>, api_id: i32) -> SenderPoolwhere
S: Session + 'static,
Creates a new sender pool instance with default configuration, attached to the given session and using the provided Application Identifier belonging to the developer.
Session instance should not be reused by multiple pools at the same time. The session instance will only be used to query datacenter options and persist any permanent Authorization Keys generated for previously-unconncected datacenters.
Sourcepub fn with_configuration<S>(
session: Arc<S>,
api_id: i32,
connection_params: ConnectionParams,
) -> SenderPoolwhere
S: Session + 'static,
pub fn with_configuration<S>(
session: Arc<S>,
api_id: i32,
connection_params: ConnectionParams,
) -> SenderPoolwhere
S: Session + 'static,
Creates a new sender pool with non-ConnectionParams::default configuration.