Skip to content

Commit

Permalink
feat: refactor tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
vicvolk committed Aug 11, 2022
1 parent 813d083 commit 847aa0f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .phpunit.result.cache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":1,"defects":{"Tests\\DefaultPoolExecutorTest::testTaskExecution":4},"times":{"Tests\\PoolExecutorTest::testBlockingQueue":0.011,"Tests\\PoolExecutorTest::testTaskExecution":0.01,"Tests\\DefaultPoolExecutorTest::testBlockingQueue":0.015,"Tests\\DefaultPoolExecutorTest::testTaskExecution":0.038}}
{"version":1,"defects":{"Tests\\DefaultPoolExecutorTest::testTaskExecution":4},"times":{"Tests\\PoolExecutorTest::testBlockingQueue":0.011,"Tests\\PoolExecutorTest::testTaskExecution":0.01,"Tests\\DefaultPoolExecutorTest::testBlockingQueue":0.012,"Tests\\DefaultPoolExecutorTest::testTaskExecution":0.013}}
2 changes: 1 addition & 1 deletion src/Executor/DefaultPoolExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
RunnableInterface,
ThreadInterface
};
use Concurrent\Time\TimeUnit;
use Concurrent\TimeUnit;
use Concurrent\Queue\ArrayBlockingQueue;
use Concurrent\Worker\WorkerFactory;

Expand Down
5 changes: 4 additions & 1 deletion src/Queue/ArrayBlockingQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

namespace Concurrent\Queue;

use Concurrent\ThreadInterface;
use Concurrent\{
ThreadInterface,
TimeUnit
};

class ArrayBlockingQueue extends AbstractQueue implements BlockingQueueInterface
{
Expand Down
4 changes: 3 additions & 1 deletion src/Time/TimerTask.php → src/Task/TimerTask.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

namespace Concurrent\Time;
namespace Concurrent\Task;

use Concurrent\RunnableInterface;

abstract class TimerTask implements RunnableInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Time/TimeUnit.php → src/TimeUnit.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Concurrent\Time;
namespace Concurrent;

class TimeUnit
{
Expand Down
4 changes: 2 additions & 2 deletions tests/DefaultPoolExecutorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace Tests;

use PHPUnit\Framework\TestCase;
use Concurrent\Queue\ArrayBlockingQueue;
use Concurrent\Time\TimeUnit;
use Concurrent\Executor\DefaultPoolExecutor;
use Concurrent\Queue\ArrayBlockingQueue;
use Concurrent\TimeUnit;

class DefaultPoolExecutorTest extends TestCase
{
Expand Down

0 comments on commit 847aa0f

Please sign in to comment.