This repository was archived by the owner on Dec 11, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -528,3 +528,29 @@ to implement. There is a [microservice counterpart](https://github.com/lucid-arc
528
528
to Lucid that you can check out [ here] ( https://github.com/lucid-architecture/laravel-microservice ) .
529
529
530
530
With more on the means of transitioning from a monolith to a microservice.
531
+
532
+ ### Event Hooks
533
+
534
+ Lucid exposes event hooks that allow you to listen on each dispatched feature, operation or job. This is especially useful for tracing:
535
+
536
+ ``` php
537
+ use Illuminate\Support\Facades\Event;
538
+ use Lucid\Foundation\Events\FeatureStarted;
539
+ use Lucid\Foundation\Events\OperationStarted;
540
+ use Lucid\Foundation\Events\JobStarted;
541
+
542
+ Event::listen(FeatureStarted::class, function (FeatureStarted $event) {
543
+ // $event->name
544
+ // $event->arguments
545
+ });
546
+
547
+ Event::listen(OperationStarted::class, function (OperationStarted $event) {
548
+ // $event->name
549
+ // $event->arguments
550
+ });
551
+
552
+ Event::listen(JobStarted::class, function (JobStarted $event) {
553
+ // $event->name
554
+ // $event->arguments
555
+ });
556
+ ```
You can’t perform that action at this time.
0 commit comments