Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

Commit

Permalink
add SignalManager 0.11.15
Browse files Browse the repository at this point in the history
  • Loading branch information
kobi97 committed Oct 31, 2019
1 parent c8c2ea8 commit 4617cd6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [0.11.15] - 2019-10-31
## Added
- Add `SignalManager` in `System` namespace

## [0.11.14] - 2019-10-21
## Added
- Add `ElapsedTime`
Expand Down
24 changes: 24 additions & 0 deletions lib/System/SignalManager.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace Ridibooks\Platform\Common\System;

class SignalManager
{
/** @var string pcntl_signal의 handler */
public const PCNTL_SIGNAL_HANDLER = 'Ridibooks\Platform\Common\System\SignalManager::signalHandler';

/** @var bool */
private static $CONTINUE = true;

public static function signalHandler(int $signo): void
{
if ($signo === SIGTERM) {
self::$CONTINUE = false;
}
}

public static function isContinued(): bool
{
return self::$CONTINUE;
}
}

0 comments on commit 4617cd6

Please sign in to comment.