pub fn init_replay_worker(
    mut config: WorkerConfig,
    history: &History,
) -> Result<Worker, anyhow::Error> {
    info!(
        task_queue = config.task_queue.as_str(),
        "Registering replay worker"
    );
    config.max_cached_workflows = 1;
    config.max_concurrent_wft_polls = 1;
    config.no_remote_activities = true;
    // Could possibly just use mocked pollers here?
    let client = mock_client_from_history(history, &config.task_queue);
    let run_id = history.extract_run_id_from_start()?.to_string();
    let last_event = history.last_event_id();
    let mut worker = Worker::new(config, None, Arc::new(client), MetricsContext::default());
    worker.set_shutdown_on_run_reaches_event(run_id, last_event);
    Ok(worker)
}
/// Create a worker for replaying a specific history. It will auto-shutdown as soon as the history
/// has finished being replayed. The provided client should be a mock, and this should only be used
/// for workflow testing purposes.
Create a worker for replaying a specific history. It will auto-shutdown as soon as the history
has finished being replayed. The provided client should be a mock, and this should only be used
for workflow testing purposes.
Create a worker for replaying a specific history . It will auto - shutdown as soon as the history has finished being replayed . The provided client should be a mock and this should only be used for workflow testing purposes .
pub fn init_replay_worker(
    mut config: WorkerConfig,
    history: &History,
) -> Result<Worker, anyhow::Error> {
    info!(
        task_queue = config.task_queue.as_str(),
        "Registering replay worker"
    );
    config.max_cached_workflows = 1;
    config.max_concurrent_wft_polls = 1;
    config.no_remote_activities = true;
    // Could possibly just use mocked pollers here?
    let client = mock_client_from_history(history, &config.task_queue);
    let run_id = history.extract_run_id_from_start()?.to_string();
    let last_event = history.last_event_id();
    let mut worker = Worker::new(config, None, Arc::new(client), MetricsContext::default());
    worker.set_shutdown_on_run_reaches_event(run_id, last_event);
    Ok(worker)
}
pub fn init_replay_worker ( mut config : WorkerConfig , history : & History , ) -> Result < Worker , anyhow :: Error > { info ! ( task_queue config task_queue as_str ( ) " " ) ; config . max_cached_workflows = 1 ; config . max_concurrent_wft_polls = 1 ; config . no_remote_activities = true ; // Could possibly just use mocked pollers here? let client = mock_client_from_history ( history , & config . task_queue ) ; let run_id = history . extract_run_id_from_start ( ) ? . to_string ( ) ; let last_event = history . last_event_id ( ) ; let mut worker = Worker :: new ( config , None , Arc :: new ( client ) , MetricsContext :: default ( ) ) ; worker . set_shutdown_on_run_reaches_event ( run_id , last_event ) ; Ok ( worker ) }
Create a worker for replaying a specific history.
Create a worker for replaying a specific history .
config
WorkerConfig
history
&History
config
WorkerConfig
history
&History