The biggest outcome of the summit
was recognizing that when people talk
about “events”, they actually mean
some quite different things.
Martin Fowler 「What do you mean by “Event-Driven”?」
https://martinfowler.com/articles/201701-event-driven.html
イベント is 何
LaravelにはEvent機能がある
class SendPodcastNotification
{
public function handle(PodcastProcessed $event): void
{
// ...
}
}
https://laravel.com/docs/12.x/events
Slide 65
Slide 65 text
LaravelにはEvent機能がある
class SendPodcastNotification
{
public function handle(PodcastProcessed $event): void
{
// ...
}
}
https://laravel.com/docs/12.x/events
Listenerクラス
Slide 66
Slide 66 text
LaravelにはEvent機能がある
class SendPodcastNotification
{
public function handle(PodcastProcessed $event): void
{
// ...
}
}
https://laravel.com/docs/12.x/events
引数で発行された
イベントを受け取る
Slide 67
Slide 67 text
LaravelにはEvent機能がある
class SendPodcastNotification
{
public function handle(PodcastProcessed $event): void
{
// ...
}
}
https://laravel.com/docs/12.x/events
やりたい
処理を書く
Slide 68
Slide 68 text
LaravelにはEvent機能がある
class SendPodcastNotification
{
public function handle(PodcastProcessed $event): void
{
// ...
}
}
https://laravel.com/docs/12.x/events
キューとかで動くが
同期的にも動く
Slide 69
Slide 69 text
$dispatchesEvents
Slide 70
Slide 70 text
$dispatchesEvents
class User extends Authenticatable
{
protected $dispatchesEvents = [
'saved' => UserSaved::class,
'deleted' => UserDeleted::class,
];
}
https://laravel.com/docs/12.x/eloquent
The Japanese have a small word - ma - for "that which is in
between" -
perhaps the nearest English equivalent is "interstitial".
The key in making great and growable systems is much more to
design
how its modules communicate rather than what their internal
properties
and behaviors should be.
日本語には「間」という言葉がある。おそらく最も近い英語は「interstitial」だろう。
偉大で成長可能なシステムを作る上で重要なのは、モジュールの内部特性や動
作よりも、モジュールがどのようにコミュニケーションをとるかを設計することだ。
(意訳)
Alan C.Kay
http://wiki.c2.com/?AlanKayOnMessaging
Slide 92
Slide 92 text
受注サービス
引当サービス
決済サービス
荷物作成
サービス
Order
Created
pub
sub
sub
sub
こいつが鍵って…コト!?