Skip to content

Commit

Permalink
Merge pull request #45 from ackintosh/feature/refactoring
Browse files Browse the repository at this point in the history
Refactoring
  • Loading branch information
ackintosh committed Oct 2, 2021
2 parents c084ee0 + a5943f3 commit b33cece
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 46 deletions.
13 changes: 7 additions & 6 deletions src/Snidel.php
Expand Up @@ -9,16 +9,17 @@
use Ackintosh\Snidel\Log;
use Ackintosh\Snidel\Pcntl;
use Ackintosh\Snidel\Task\Task;
use RuntimeException;

class Snidel
{
/** @var \Ackintosh\Snidel\Config */
/** @var Config */
private $config;

/** @var \Ackintosh\Snidel\Fork\Coordinator */
/** @var Coordinator */
private $coordinator;

/** @var \Ackintosh\Snidel\Log */
/** @var Log */
private $log;

/** @var array */
Expand All @@ -29,7 +30,7 @@ class Snidel

/**
* @param array $parameter
* @throws \RuntimeException
* @throws RuntimeException
*/
public function __construct(array $parameter = [])
{
Expand All @@ -44,13 +45,13 @@ public function __construct(array $parameter = [])
/**
* this method uses master / worker model.
*
* @throws \RuntimeException
* @throws RuntimeException
*/
public function process(callable $callable, array $args = [], ?string $tag = null): void
{
try {
$this->coordinator->enqueue(new Task($callable, $args, $tag));
} catch (\RuntimeException $e) {
} catch (RuntimeException $e) {
$this->log->error('failed to enqueue the task: ' . $e->getMessage());
throw $e;
}
Expand Down
10 changes: 0 additions & 10 deletions tests/ftok.php

This file was deleted.

10 changes: 0 additions & 10 deletions tests/msg_receive.php

This file was deleted.

10 changes: 0 additions & 10 deletions tests/msg_send.php

This file was deleted.

10 changes: 0 additions & 10 deletions tests/shmop_delete.php

This file was deleted.

0 comments on commit b33cece

Please sign in to comment.