Skip to content
This repository was archived by the owner on Feb 6, 2019. It is now read-only.

Commit fb6d4a3

Browse files
committed
(docs) updated changelog, fixed api docs
1 parent ee34fb4 commit fb6d4a3

File tree

2 files changed

+15
-24
lines changed

2 files changed

+15
-24
lines changed

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
## [Unreleased]
88

9+
## [2.0.0] - 18.10.2017
10+
### [Added]
11+
* signal handling
12+
13+
### [Removed]
14+
* `checkFail`, `checkAvailable`
15+
16+
### [Fixed]
17+
* forking, so that childs exit on closure run
18+
919

1020
## [1.0.1] - 18.10.2017
1121
### [Fixed]

README.md

+5-24
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,32 @@ $ composer require troublete/task
1616
<?php
1717
require_once '/path/to/autoload.php';
1818

19-
use function Task\{forkTask, checkFail, checkSuccess};
19+
use function Task\{forkTask, checkSuccess};
2020

2121
$pid = forkTask(function () {
2222
// do something that is only happening in the forked process
2323
});
2424

2525
// continue work...
2626

27-
checkFail($pid); // to check if the process failed
2827
checkSuccess($pid); // to check if the process finished with great success
2928
```
3029

3130
## API
3231

3332
### Functions
3433

35-
#### forkTask($taskClosure)
34+
#### forkTask($taskClosure, $arguments = [], $signalHandler = null)
3635

37-
Function to fork off a child process. Returns the `pid` of the forked off process if successfull, throws an Exception if forking was not possible.
36+
Function to fork off a child process. Returns the `pid` of the forked off process if successfull, throws an Exception if forking was not possible.
3837

3938
##### Arguments
4039

4140
| Argument | Type | Description |
4241
|---|---|---|
4342
| $taskClosure | `callable` | Closure function that is only executed in the child process |
43+
| $arguments | `array` | Arguments that are passed to the child process closure (optional) |
44+
| $signalHandler | `callable` | Handler for process signals (optional) |
4445

4546
#### getProcessStatus($processId = null)
4647

@@ -52,16 +53,6 @@ Function that returns that status of a forked child by process id. If provided p
5253
|---|---|---|
5354
| $processId | `int` | Id of the process to be checked |
5455

55-
#### checkAvailable($processId = null)
56-
57-
Function to check if a process exists.
58-
59-
##### Arguments
60-
61-
| Argument | Type | Description |
62-
|---|---|---|
63-
| $processId | `int` | Id of the process to be checked |
64-
6556
#### checkSuccess($processId = null)
6657

6758
Function that returns based on the process status if a process already finished with great success. If the return value of this is `false` it does not necessarily mean that the process failed though. Since this is a non blocking process check. It is just not successfully finished at the point of the check.
@@ -72,16 +63,6 @@ Function that returns based on the process status if a process already finished
7263
|---|---|---|
7364
| $processId | `int` | Id of the process to be checked |
7465

75-
#### checkFail($processId = null)
76-
77-
Function that checks if a processed failed. If the return value is `false` it does not mean that the process didnt fail. Since this is a non blocking check, it is just not failed in the moment of the check.
78-
79-
##### Arguments
80-
81-
| Argument | Type | Description |
82-
|---|---|---|
83-
| $processId | `int` | Id of the process to be checked |
84-
8566
#### closeTask($processId = null)
8667

8768
Function to close a forked process. Returns `true` if successfull.

0 commit comments

Comments
 (0)