C# Class BlueCollar.Machine

Provides machine coordination services, managing all workers on a machine for an application.
Inheritance: IDisposable
Show file Open project: ChadBurggraf/blue-collar

Public Methods

Method Description
Machine ( ) : System

Initializes a new instance of the Machine class.

Machine ( ILogger logger ) : System

Initializes a new instance of the Machine class.

Machine ( ILogger logger, IRepositoryFactory repositoryFactory, string applicationName, string address, string name, int heartbeat, int workerHeartbeat, bool schedulerEnabled, bool ensureDefaultWorker ) : System

Initializes a new instance of the Machine class.

Private Methods

Method Description
CreateDefaultWorker ( ) : Worker

Creates a default worker.

Dispose ( ) : void
Dispose ( bool force ) : void
Dispose ( bool force, bool disposing ) : void
GetMachineAddress ( ) : string
GetPrivateMachineAddress ( ) : string

Gets the current machine's private IP address.

GetPublicMachineAddress ( ) : string

Gets the current machine's public IP address.

RefreshWorkers ( ) : void
RunLoop ( ) : void
WorkerDisposing ( object sender, EventArgs e ) : void

Handles a worker's Disposing event.

Method Details

Machine() public method

Initializes a new instance of the Machine class.
public Machine ( ) : System
return System

Machine() public method

Initializes a new instance of the Machine class.
public Machine ( ILogger logger ) : System
logger ILogger The logger to use when logging messages.
return System

Machine() public method

Initializes a new instance of the Machine class.
public Machine ( ILogger logger, IRepositoryFactory repositoryFactory, string applicationName, string address, string name, int heartbeat, int workerHeartbeat, bool schedulerEnabled, bool ensureDefaultWorker ) : System
logger ILogger The logger to use when logging messages.
repositoryFactory IRepositoryFactory The repository factory to use when creating repositories for data access.
applicationName string The name of the application to manage workers for.
address string The address of the machine.
name string The name of the machine.
heartbeat int The heartbeat, in seconds, to use when polling for additions or removal of workers.
workerHeartbeat int The heartbeat, in seconds, the workers should use when polling for work.
schedulerEnabled bool A value indicating whether the job scheduler is enabled.
ensureDefaultWorker bool A value indicating whether to ensure at least one worker exists, creating it if necessary.
return System