Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Messenger] Add documentation forallow_no_senders#17383

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
javiereguiluz merged 1 commit intosymfony:6.2frombabeuloula:doc/17378-allow-no-senders
Oct 21, 2022
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletionsmessenger/multiple_buses.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,7 +36,12 @@ an **event bus**. The event bus could have zero or more subscribers.
event.bus:
# the 'allow_no_handlers' middleware allows to have no handler
# configured for this bus without throwing an exception
default_middleware: allow_no_handlers
# the 'allow_no_senders' middleware allows to have no sender
# configured for this bus without throwing an exception
default_middleware:
enabled: true
allow_no_handlers: false
allow_no_senders: true
middleware:
- validation

Expand DownExpand Up@@ -64,7 +69,10 @@ an **event bus**. The event bus could have zero or more subscribers.
</framework:bus>
<!-- the 'allow_no_handlers' middleware allows to have no handler
configured for this bus without throwing an exception -->
<framework:bus name="event.bus" default-middleware="allow_no_handlers">
<!-- the 'allow_no_senders' middleware allows to have no sender
configured for this bus without throwing an exception -->
<framework:bus name="event.bus">
<framework:default-middleware enabled="true" allow_no_handlers="false" allow_no_senders="true"/>
<framework:middleware id="validation"/>
</framework:bus>
</framework:messenger>
Expand All@@ -88,9 +96,15 @@ an **event bus**. The event bus could have zero or more subscribers.
$queryBus->middleware()->id('validation');

$eventBus = $framework->messenger()->bus('event.bus');
// the 'allow_no_handlers' middleware allows to have no handler
// the 'allowNoHandlers' middleware allows to have no handler
// configured for this bus without throwing an exception
// the 'allowNoSenders' middleware allows to have no sender
// configured for this bus without throwing an exception
$eventBus->defaultMiddleware('allow_no_handlers');
$eventBus->defaultMiddleware()
->enabled(true)
->allowNoHandlers(false)
->allowNoSenders(true)
;
$eventBus->middleware()->id('validation');
};

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp