Hoa central
Public Member Functions | Protected Attributes | List of all members
Hoa\Worker\Bin\Stop Class Reference
Inheritance diagram for Hoa\Worker\Bin\Stop:

Public Member Functions

 main ()
 
 usage ()
 
- Public Member Functions inherited from Hoa\Console\Dispatcher\Kit
 __construct (Router $router, Dispatcher $dispatcher, View\Viewable $view=null)
 
 getOption (&$optionValue, $short=null)
 
 setOptions (Array $options)
 
 makeUsageOptionsList (Array $definitions=[])
 
 resolveOptionAmbiguity (Array $solutions)
 
 status ($text, $status)
 
 readLine ($prefix=null)
 
 readPassword ($prefix=null)
 
- Public Member Functions inherited from Hoa\Dispatcher\Kit
 __construct (Router $router, Dispatcher $dispatcher, View\Viewable $view=null)
 
 construct ()
 

Protected Attributes

 $options
 
- Protected Attributes inherited from Hoa\Console\Dispatcher\Kit
 $options = null
 
 $_options = null
 

Additional Inherited Members

- Public Attributes inherited from Hoa\Console\Dispatcher\Kit
 $parser = null
 
- Public Attributes inherited from Hoa\Dispatcher\Kit
 $router = null
 
 $dispatcher = null
 
 $view = null
 
 $data = null
 

Detailed Description

Class .

Stop worker.

Definition at line 51 of file Stop.php.

Member Function Documentation

Hoa\Worker\Bin\Stop::main ( )

The entry method.

Returns
void

Definition at line 71 of file Stop.php.

72  {
73  $run = 'hoa://Data/Variable/Run';
74 
75  while (false !== $c = $this->getOption($v)) {
76  switch ($c) {
77  case 'r':
78  $run = $v;
79 
80  break;
81 
82  case 'h':
83  case '?':
84  return $this->usage();
85 
86  case '__ambiguous':
87  $this->resolveOptionAmbiguity($v);
88 
89  break;
90  }
91  }
92 
93  $this->parser->listInputs($workerId);
94 
95  if (null === $workerId) {
96  return $this->usage();
97  }
98 
99 
100  $run = resolve($run);
101  Core::getInstance()->initialize([
102  'protocol.Data/Variable/Run' => "\r" . $run . DS
103  ]);
104  $password = $this->readPassword('Password: ');
105  $sw = new Worker\Backend\Shared($workerId, $password);
106  $sw->stop();
107 
108  return;
109  }
readPassword($prefix=null)
Definition: Kit.php:260
static getInstance()
Definition: Core.php:193
getOption(&$optionValue, $short=null)
Definition: Kit.php:104
resolveOptionAmbiguity(Array $solutions)
Definition: Kit.php:190

Here is the call graph for this function:

Hoa\Worker\Bin\Stop::usage ( )

The command usage.

Returns
void

Definition at line 116 of file Stop.php.

117  {
118  echo
119  'Usage : worker:stop <options> <worker_id>', "\n",
120  'Options :', "\n",
121  $this->makeUsageOptionsList([
122  'run' => 'Define hoa://Data/Variable/Run/ path.',
123  'help' => 'This help.'
124  ]), "\n";
125 
126  return;
127  }
makeUsageOptionsList(Array $definitions=[])
Definition: Kit.php:149

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

Hoa\Worker\Bin\Stop::$options
protected
Initial value:

Definition at line 58 of file Stop.php.


The documentation for this class was generated from the following file: