use graphile_worker_database::NotificationStream;
use graphile_worker_runtime as runtime;
use graphile_worker_shutdown_signal::ShutdownSignal;
use crate::local_queue::LocalQueueSignalReceiver;
use super::JobSignalSource;
pub(super) struct JobSignalStreamData {
pub(super) interval: runtime::Interval,
pub(super) pg_listener: Option<NotificationStream>,
pub(super) shutdown_signal: ShutdownSignal,
pub(super) local_queue_rx: Option<LocalQueueSignalReceiver>,
}
impl JobSignalStreamData {
pub(super) fn new(
interval: runtime::Interval,
pg_listener: Option<NotificationStream>,
shutdown_signal: ShutdownSignal,
local_queue_rx: Option<LocalQueueSignalReceiver>,
) -> Self {
Self {
interval,
pg_listener,
shutdown_signal,
local_queue_rx,
}
}
}
pub(super) enum NextSignal {
Source(JobSignalSource),
LocalQueueClosed,
NotificationListenerClosed,
Shutdown,
}