Skip to content

Commit

Permalink
Include some tips
Browse files Browse the repository at this point in the history
  • Loading branch information
Vectorial1024 committed Jan 4, 2025
1 parent 17dbefa commit f3d5d73
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ If you are on Unix, check that you also have the following:
## Change log
Please see `CHANGELOG.md`.

## Example code
## Example code and features
Tasks can be defined as PHP closures, or (recommended) as an instance of a class that implements `AsyncTaskInterface`.

A very simple example task to write Hello World to a file:
Expand Down Expand Up @@ -87,6 +87,11 @@ $task->withTimeLimit(15)->start();
$task->withoutTimeLimit()->start();
```

Some tips:
- Don't sleep too long! On Windows, timeout handlers cannot trigger while your task is sleeping.
- Use short but frequent sleeps instead.
- Avoid using `SIGINT`! On Unix, this signal is reserved for timeout detection.

## Testing
PHPUnit via Composer script:
```sh
Expand Down

0 comments on commit f3d5d73

Please sign in to comment.