变更
This commit is contained in:
@@ -70,6 +70,15 @@ abstract class Actor implements ActorInterface, JsonSerializable
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function init(): void
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $id
|
* @param $id
|
||||||
* @return static
|
* @return static
|
||||||
@@ -115,6 +124,7 @@ abstract class Actor implements ActorInterface, JsonSerializable
|
|||||||
public function run(): void
|
public function run(): void
|
||||||
{
|
{
|
||||||
$this->setState(ActorState::BUSY);
|
$this->setState(ActorState::BUSY);
|
||||||
|
$this->init();
|
||||||
$this->loop();
|
$this->loop();
|
||||||
$this->setState(ActorState::IDLE);
|
$this->setState(ActorState::IDLE);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user