Struct fc_mapping_sync::sql::SyncWorker
source · pub struct SyncWorker<Block, Backend, Client> { /* private fields */ }
Expand description
Implements an indexer that imports blocks and their transactions.
Implementations§
source§impl<Block, Backend, Client> SyncWorker<Block, Backend, Client>where
Block: BlockT<Hash = H256> + BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + StorageProvider<Block, Backend> + 'static,
Client::Api: EthereumRuntimeRPCApi<Block>,
Backend: BackendT<Block> + 'static,
Backend::State: StateBackend<BlakeTwo256>,
impl<Block, Backend, Client> SyncWorker<Block, Backend, Client>where
Block: BlockT<Hash = H256> + BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + StorageProvider<Block, Backend> + 'static,
Client::Api: EthereumRuntimeRPCApi<Block>,
Backend: BackendT<Block> + 'static,
Backend::State: StateBackend<BlakeTwo256>,
sourcepub async fn spawn_worker(
client: Arc<Client>,
substrate_backend: Arc<Backend>,
indexer_backend: Arc<Backend<Block>>,
pubsub_notification_sinks: Arc<EthereumBlockNotificationSinks<EthereumBlockNotification<Block>>>
) -> Sender<WorkerCommand>
pub async fn spawn_worker( client: Arc<Client>, substrate_backend: Arc<Backend>, indexer_backend: Arc<Backend<Block>>, pubsub_notification_sinks: Arc<EthereumBlockNotificationSinks<EthereumBlockNotification<Block>>> ) -> Sender<WorkerCommand>
Spawn the indexing worker. The worker can be given commands via the sender channel. Once the buffer is full, attempts to send new messages will wait until a message is read from the channel.
sourcepub async fn run(
client: Arc<Client>,
substrate_backend: Arc<Backend>,
indexer_backend: Arc<Backend<Block>>,
import_notifications: ImportNotifications<Block>,
worker_config: SyncWorkerConfig,
_sync_strategy: SyncStrategy,
sync_oracle: Arc<dyn SyncOracle + Send + Sync + 'static>,
pubsub_notification_sinks: Arc<EthereumBlockNotificationSinks<EthereumBlockNotification<Block>>>
)
pub async fn run( client: Arc<Client>, substrate_backend: Arc<Backend>, indexer_backend: Arc<Backend<Block>>, import_notifications: ImportNotifications<Block>, worker_config: SyncWorkerConfig, _sync_strategy: SyncStrategy, sync_oracle: Arc<dyn SyncOracle + Send + Sync + 'static>, pubsub_notification_sinks: Arc<EthereumBlockNotificationSinks<EthereumBlockNotification<Block>>> )
Start the worker.
Auto Trait Implementations§
impl<Block, Backend, Client> RefUnwindSafe for SyncWorker<Block, Backend, Client>
impl<Block, Backend, Client> Send for SyncWorker<Block, Backend, Client>
impl<Block, Backend, Client> Sync for SyncWorker<Block, Backend, Client>
impl<Block, Backend, Client> Unpin for SyncWorker<Block, Backend, Client>
impl<Block, Backend, Client> UnwindSafe for SyncWorker<Block, Backend, Client>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
§fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IsType<T> for T
impl<T> IsType<T> for T
§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of
T
. Read more§impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
type Error = <U as TryFromKey<T>>::Error
fn try_into_key(self) -> Result<U, <U as TryFromKey<T>>::Error>
§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from
.§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T
.