Skip to content

Commit 58d86d2

Browse files
authored
Update README.md
1 parent 556adfb commit 58d86d2

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ All you need to have installed: _pcntl_ and _posix_ extensions.
3535

3636
### How to create your Worker
3737

38-
The all you need it to inherit `Worker` class (full name is _wapmorgan\Threadable\Worker_) and redefine `onPayload(array $data)` public method.
38+
The all you need it to inherit `Worker` class (full name is _wapmorgan\Threadable\Worker_) and redefine `onPayload($data)` public method.
3939

4040
For example:
4141
```php
4242
use wapmorgan\Threadable\Worker;
4343
class SleepingWorker extends Worker
4444
{
45-
public function onPayload(array $data)
45+
public function onPayload($data)
4646
{
4747
echo 'I have started at '.date('r').PHP_EOL;
4848
sleep(3);
@@ -69,7 +69,7 @@ To use it correctly you need to understand the life-cycle of worker:
6969
4. Worker stops or being killed by `stop()` or `kill()` methods respectively.
7070
5. Worker manager checks if worker thread has finished and marks itself terminated. To do this call `checkForTermination()`.
7171

72-
Background work happens in **2 steps**, where worker thread runs `onPayload(array $data)` method of class with actual payload.
72+
Background work happens in **2 steps**, where worker thread runs `onPayload($data)` method of class with actual payload.
7373

7474
To summarize, this is an example of downloading file in another thread with real-time displaying of progress:
7575

@@ -78,7 +78,7 @@ To summarize, this is an example of downloading file in another thread with real
7878
// Implement class-downloader
7979
class DownloadWorker extends Worker
8080
{
81-
public function onPayload(array $data)
81+
public function onPayload($data)
8282
{
8383
echo 'Started '.$data[0].' into '.$data[2].PHP_EOL;
8484
copy($data[0], $data[2]);

0 commit comments

Comments
 (0)