<?php
/**
 * Selected scheduling services.
 *
 * @package ScheduledChanges
 */

namespace ScheduledChanges\Bootstrap;

use ScheduledChanges\Scheduler\QueueMonitor;
use ScheduledChanges\Scheduler\SchedulerService;

/**
 * Carries queue services created from the resolved module graph.
 */
final class CoreSchedulingRuntime {
	private ?SchedulerService $scheduler;
	private ?QueueMonitor $queue;

	/**
	 * Creates the selected scheduling runtime.
	 */
	public function __construct( ?SchedulerService $scheduler, ?QueueMonitor $queue ) {
		$this->scheduler = $scheduler;
		$this->queue     = $queue;
	}

	/**
	 * Returns scheduling when selected.
	 */
	public function scheduler(): ?SchedulerService {
		return $this->scheduler;
	}

	/**
	 * Returns queue diagnostics when selected.
	 */
	public function queue(): ?QueueMonitor {
		return $this->queue;
	}
}
