Lines 100.00% 1 / 1
Functions and Methods 100.00% 1 / 1
Classes and Traits 100.00% 1 / 1
Name Lines Functions and Methods CRAP Classes and Traits
AppPauseCommand 100.00% 1 / 1 100.00% 1 / 1 1 100.00% 1 / 1
 sendAppRequest 100.00% 1 / 1 100.00% 1 / 1 1
1<?php
2
3declare(strict_types=1);
4
5namespace Stewart\Runtime\Console;
6
7use Stewart\Contracts\App\AppId;
8use Stewart\Contracts\Time\Duration;
9use Stewart\Runtime\Control\Client\ControlTarget;
10use Stewart\Runtime\Control\Protocol\Frame\CommandResult;
11use Symfony\Component\Console\Attribute\AsCommand;
12
13#[AsCommand(name: self::NAME, description: 'Pause one app: it stays loaded but skips deliveries and schedules until resumed')]
14final class AppPauseCommand extends AppRequestCommand
15{
16    public const string NAME = 'app:pause';
17
18    protected function sendAppRequest(ControlTarget $target, AppId $appId, Duration $timeout): CommandResult
19    {
20        return $this->client->pauseApp($target, $appId, $timeout);
21    }
22}