soneritics/pcntl

PCNTL helper methods

Installs: 46

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/soneritics/pcntl

1.1 2017-08-14 20:14 UTC

This package is auto-updated.

Last update: 2025-09-23 20:07:45 UTC


README

Build Status Coverage Status License

by

Introduction

Helper method for working with forks.

Minimum Requirements

  • PHP 7.1

Features

  • tbd
  • tbd

Example

The following PHP code is a minimal example of one of the possibilities of this library.

(new \PCNTL\ThreadStart)->startAndWait(
    (new \PCNTL\ThreadCollection)
        ->add(new ExampleClass('Test 1'))
        ->add(new ExampleClass('Test 2'))
        ->add(new ExampleClass('Test 3'))
        ->add(new ExampleClass('Test 4'))
        ->add(new ExampleClass('Test 5'))
);

Running multiple threads (forks), output will look like:

Starting
Starting Test 1
Starting Test 2
Starting Test 3
Starting Test 5
Starting Test 4
Ended Test 1
Ended Test 3
Ended Test 5
Ended Test 2
Ended Test 4
Program is done.