nvflare.app_common.job_schedulers.job_scheduler module

class DefaultJobScheduler(max_jobs: int = 1)[source]

Bases: JobSchedulerSpec, FLComponent

handle_event(event_type: str, fl_ctx: FLContext)[source]

Handles events.

Parameters
  • event_type (str) – event type fired by workflow.

  • fl_ctx (FLContext) – FLContext information.

schedule_job(job_candidates: List[Job], fl_ctx: FLContext)[source]

Try to schedule a Job.

Parameters
  • job_candidates – The candidate to choose from.

  • fl_ctx – FLContext.

Returns

A tuple of (job, sites_dispatch_info), if there is a Job that satisfy the criteria of the scheduler. sites_dispatch_info is a dict of {site name: DispatchInfo}. Otherwise, return (None, None).