# Custom process [hyperf/process](https://github.com/hyperf-cloud/process) allows you to add user-defined processes. This feature is usually used to create a special process for monitoring, reporting or other special tasks. When the server starts, it will automatically create a process and execute the specified subprocess. If the process exits unexpectedly, the server will automatically restart the process. ## Create a custom process Implement a subclass that inherits `Hyperf\Process\AbstractProcess` and implement the interface method `handle(): void`, with your logic code in the method. Let's take this code as an example: ```php When using `#[Process]` annotation, `use Hyperf\Process\Annotation\Process;` namespace is required; ## Add conditions for process startup Sometimes a custom process should not be started at all times. Whether a custom process is started or not may be determined according to certain configurations or conditions by overriding `isEnable(): bool` method in the custom process class. The method is implemented by default with the return value of `true`, which will start with the service. If the method returns `false`, the custom process will not be started when the service starts. ```php container->get(StdoutLoggerInterface::class); while (true) { $redis = $this->container->get(\Redis::class); $count = $redis->llen('queue:failed'); if ($count > 0) { $logger->warning('The num of failed queue is ' . $count); } sleep(1); } } } ```