Bitcoin and Altcoin Wallets 6.4.1

Moves_Task extends Task
in package

Cron task abstract class.

Concrete implementations of a task must extend this and implement run();

Applications can use $this->log() for logging.

Table of Contents

Properties

$name  : mixed
$priority  : mixed
$task_start_time  : mixed
$timeout  : mixed
$verbose  : mixed
$currency  : mixed
$moves_batch  : mixed
$start_memory  : mixed
$start_time  : mixed

Methods

__construct()  : mixed
Constructor hooks this task into the cron job action.
log()  : void
Cron task logging.
register()  : void
run()  : void
Do the task.
weed_out_bad_moves()  : array<string|int, mixed>
execute_some_moves()  : mixed
get_cron_interval()  : int
get_next_currency_with_pending_moves()  : Currency|null
Get next currency with pending moves (aka internal transfers).

Properties

$name

protected mixed $name
Tags
@var

$name string The name of this task.

$priority

protected mixed $priority = 10
Tags
@var

$priority int The priority with which to attach to cron action.

$task_start_time

protected mixed $task_start_time = 0
Tags
@var

$task_start_time int Timestamp at which this task is starting execution.

$timeout

protected mixed $timeout = DEFAULT_CRON_TASK_TIMEOUT
Tags
@var

$timeout How many seconds this task is allowed to run. The task's run() method must respect this limit.

$verbose

protected mixed $verbose = false
Tags
@var

$verbose boolean Whether to write all log() output to debug log.

$start_memory

private static mixed $start_memory = 0
Tags
@var

$start_memory int Memory used at start of tasks batch execution, measured in bytes.

$start_time

private static mixed $start_time = 0
Tags
@var

$start_time int Timestamp at which tasks batch starts execution.

Methods

__construct()

Constructor hooks this task into the cron job action.

public __construct() : mixed

Call this after your sub-class constructor. This way, any changes you make to $this->priority will have an effect. WARNING: If you forget to call parent::__construct();, your task will not run.

log()

Cron task logging.

public final log(string $message[, bool $force = false ]) : void

Migration task is always logged.

Parameters
$message : string

The string to log.

$force : bool = false

Whether to force log the string, even if no verbose logging is checked.

run()

Do the task.

public run() : void

Concrete implementations must do the work here in chuncks. The max execution time, usually about 15 or 30 secs must be eenough for all the tasks. So be careful!

weed_out_bad_moves()

public weed_out_bad_moves(array<string|int, mixed> $moves_batch) : array<string|int, mixed>
Parameters
$moves_batch : array<string|int, mixed>
Return values
array<string|int, mixed>

get_cron_interval()

private static get_cron_interval() : int
Return values
int

get_next_currency_with_pending_moves()

Get next currency with pending moves (aka internal transfers).

private get_next_currency_with_pending_moves() : Currency|null

All currencies with enabled unlocked wallets are processed, one currency per cron run, with no starvation. Currencies with no pending moves are skipped. If no eligible currencies have pending moves, the loop ends.

Return values
Currency|null

        
On this page

Search results