File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ class Main extends Application // like that one in c++
44
44
public function run()
45
45
{
46
46
$worker = $this->createWorker(MyWorker::class); // create external non-blocking thread of MyWorker class
47
- $worker->event ('any_event', 'Hello my worker!');
47
+ $worker->emit ('any_event', 'Hello my worker!');
48
48
$worker->on('hello_master', function() {
49
49
// Receive back-call from child
50
50
});
@@ -58,8 +58,8 @@ class MyWorker extends Application
58
58
$this->on('any_event', function($data) {
59
59
echo 'Got any_event event from my master: ' . $data; // data == Hello my worker
60
60
// Still we can send any event back to master
61
- $this->event ('hello_master');
62
- $this->event ('send-any-data', new Data()); // you can send any object, array or scalar
61
+ $this->emit ('hello_master');
62
+ $this->emit ('send-any-data', new Data()); // you can send any object, array or scalar
63
63
// object should have jms serializer metadata to be serialized
64
64
});
65
65
}
You can’t perform that action at this time.
0 commit comments