-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created dedicated class Adapter\Tornado\Internal\Task
- Loading branch information
Benoit Viguier
committed
Oct 24, 2018
1 parent
29f45c2
commit 4d1d819
Showing
2 changed files
with
43 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace M6Web\Tornado\Adapter\Tornado\Internal; | ||
|
||
/** | ||
* @internal | ||
* ⚠️ You must NOT rely on this internal implementation | ||
*/ | ||
class Task | ||
{ | ||
private $generator; | ||
private $promise; | ||
|
||
public function __construct(\Generator $generator) | ||
{ | ||
$this->generator = $generator; | ||
$this->promise = new PendingPromise(); | ||
} | ||
|
||
public function getPromise(): PendingPromise | ||
{ | ||
return $this->promise; | ||
} | ||
|
||
public function getGenerator(): \Generator | ||
{ | ||
return $this->generator; | ||
} | ||
} |