Fields (2) Events (3) Methods (8) Properties (4)
Namespace: SchwabenCode.QuickIO.Transfer

Syntax

public abstract class QuickIOTransferJob : IQuickIOTransferJob

Implements

Summary

A job is a defined task is performed by the method Run Here, you can define the content of the task itself.

Uses

Fields

private  Int32 _currentRetryCount
private  Int32 _priorityLevel

Events

End

This event is raised at the end Run

public End

Error

This event is triggered if Run has an error

public Error

RunRaised

This event is raised when Run is called

public RunRaised

Methods

protected void QuickIOTransferJob(IQuickIOTransferObserver observer, Int32 priorityLevel)

Parameters

observer

IQuickIOTransferObserver

Observer for file monitoring by service

priorityLevel

Int32

Default priority

Remarks

Thread-safe

QuickIOTransferJob(Int32 priorityLevel)

Creates a new instance of QuickIOTransferJob

protected void QuickIOTransferJob(Int32 priorityLevel)

Parameters

priorityLevel

Int32

Default priority

Remarks

Thread-safe

Implementation()

Implementation. It is executed by default without a background thread. The method can block.

protected abstract void Implementation()
protected virtual void OnEnd(DateTime started, DateTime finished)
protected virtual void OnError(Exception e)

OnRun(DateTime started)

Fires RunRaised

protected virtual void OnRun(DateTime started)

Run()

Executes Implementation

public void Run()

Example

Contains following content

public void Run( )
{
var started = DateTime.Now;
OnRun( started );
try
{
    Implementation( );
}
catch ( Exception e )
{
    OnError( e );
    throw;
}
OnEnd( started, DateTime.Now );
}

RunAsync()

Executes Run in Async context

public Task RunAsync()

Properties

CurrentRetryCount

Retry count before firing broken exception

public Int32 CurrentRetryCount { get; set; }

Remarks

Thread-safe

JobType

JobType

internal abstract QuickIOTransferJobType JobType { get; }

Observer

Central observer

public IQuickIOTransferObserver Observer { get; set; }

PriorityLevel

Prority level. Higher priority = higher value. 0 = default

public Int32 PriorityLevel { get; set; }

Remarks

Thread-safe