-
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.
Merge branch 'master' of https://github.com/swoft-cloud/swoft-component…
… into dev2
- Loading branch information
Showing
8 changed files
with
142 additions
and
15 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
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
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,58 @@ | ||
<?php | ||
/** | ||
* This file is part of Swoft. | ||
* | ||
* @link https://swoft.org | ||
* @document https://swoft.org/docs | ||
* @contact [email protected] | ||
* @license https://github.com/swoft-cloud/swoft/blob/master/LICENSE | ||
*/ | ||
|
||
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
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