Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Schedule actions to file or directories and execute them later

License

Notifications You must be signed in to change notification settings

jibedoubleve/FileOperationScheduler

Repository files navigation

FileOperationScheduler

Schedule actions to file or directories and execute them later

Documentation

How to use it?

// Retrieve an operation scheduler from a default location
// If the file doesn't exist, it'll create one and put default
// values (i.e. no value)
var opScheduler = await OperationSchedulerFactory.RetrieveFromFileAsync(fileName);

// Plan the actions to execute.
// Calling `Commit()` will save the operation
// and they'll be executed next time we call
// ProcessOperations()

var opDir = OperationFactory.RemoveDir(directory, recursive: true);
var opZip = OperationFactory.Unzip(zip, destination);

opScheduler.AddOperation(opDir)
           .AddOperation(opZip)
           .SavePlanAsync();

// Later, after either the machine or the application 
// have been restarted, call ExecutePlanAsync()
// to execute the operations

var scheduler = await OperationSchedulerFactory.RetrieveFromFileAsync(fileName);
await scheduler.ExecutePlanAsync();

About

Schedule actions to file or directories and execute them later

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages