Trait polkadot_node_subsystem_util::JobTrait [−][src]
pub trait JobTrait: Unpin + Sized {
type ToJob: 'static + BoundToRelayParent + Send;
type Error: 'static + Error + Send;
type RunArgs: 'static + Send;
type Metrics: 'static + Metrics + Send;
const NAME: &'static str;
fn run<S: SubsystemSender>(
parent: Hash,
span: Arc<Span>,
run_args: Self::RunArgs,
metrics: Self::Metrics,
receiver: Receiver<Self::ToJob>,
sender: JobSender<S>
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send>>;
}
Expand description
This trait governs jobs.
Jobs are instantiated and killed automatically on appropriate overseer messages. Other messages are passed along to and from the job via the overseer to other subsystems.
Associated Types
type ToJob: 'static + BoundToRelayParent + Send
type ToJob: 'static + BoundToRelayParent + Send
Message type used to send messages to the job.
Extra arguments this job needs to run properly.
If no extra information is needed, it is perfectly acceptable to set it to ()
.
Associated Constants
Required methods
Run a job for the given relay parent
.
The job should be ended when receiver
returns None
.