-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update. PIPE_MESSAGE事件结束后触发COROUTINE_DEFER, COROUTINE_COMPLETE
- Loading branch information
Showing
2 changed files
with
82 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
/** | ||
* The file is part of the swoft_marketing_engine. | ||
* | ||
* (c) alan <[email protected]>. | ||
* | ||
* 2021/1/3 1:43 下午 | ||
*/ | ||
|
||
namespace Swoft\Server\Context; | ||
|
||
use Swoft\Bean\Annotation\Mapping\Bean; | ||
use Swoft\Bean\Concern\PrototypeTrait; | ||
use Swoft\Context\AbstractContext; | ||
|
||
/** | ||
* Class PipeMessageContext | ||
* @package App\Context | ||
* | ||
* @Bean(scope=Bean::PROTOTYPE) | ||
*/ | ||
class PipeMessageContext extends AbstractContext | ||
{ | ||
use PrototypeTrait; | ||
|
||
/** | ||
* @param int $srcWorkerId | ||
* @param $pipeMessage | ||
* @return PipeMessageContext | ||
*/ | ||
public static function new(int $srcWorkerId, $pipeMessage): self | ||
{ | ||
$self = self::__instance(); | ||
|
||
$self->set('srcWorkerId', $srcWorkerId); | ||
$self->set('pipeMessage', $pipeMessage); | ||
|
||
return $self; | ||
} | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getSrcWorkerId(): int | ||
{ | ||
return $this->get('srcWorkerId'); | ||
} | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getPipeMessage() | ||
{ | ||
return $this->get('pipeMessage'); | ||
} | ||
} | ||
|
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