Commit 3abca64
committed
feature #30707 [Messenger][DX] Allow stamps to be passed directly to MessageBusInterface::dispatch() (weaverryan)
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger][DX] Allow stamps to be passed directly to MessageBusInterface::dispatch()
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | yes
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | none
| License | MIT
| Doc PR | TODO
Me again o/!
This proposal is *purely* for DX. With `DelayStamp`, the proposal of QueueNameStamp and future things like `AmqpRoutingKeyStamp`, stamps are becoming more common for end users to use. This changes how it looks to use them:
```php
// before
$bus->dispatch(new Envelope(new SendSmsNotification('Hi!'), new DelayStamp(10), new QueueNameStamp('low')));
// after
$bus->dispatch(new SendSmsNotification('Hi!'), [new DelayStamp(10), new QueueNameStamp('low')]);
```
It's definitely a BC break, which is allowed because the component is experimental, though it should be minimized. This BC break shouldn't be felt by most end users, as creating your own bus is an advanced use-case. Even if you decorated it, you'll get an obvious error.
Commits
-------
e861de7 Allow stamps to be passed directly to MessageBusInterface::dispatch()File tree
Expand file treeCollapse file tree
18 files changed
+115
-52
lines changedOpen diff view settings
Filter options
- src/Symfony/Component/Messenger
- Tests
- Middleware
- Retry
- Transport/AmqpExt
- Fixtures
- Transport/Serialization
Expand file treeCollapse file tree
18 files changed
+115
-52
lines changedOpen diff view settings
Collapse file
src/Symfony/Component/Messenger/CHANGELOG.md
Copy file name to clipboardExpand all lines: src/Symfony/Component/Messenger/CHANGELOG.md+6Lines changed: 6 additions & 0 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
4 | 4 | |
5 | 5 | |
6 | 6 | |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
7 | 13 | |
8 | 14 | |
9 | 15 | |
|
Collapse file
src/Symfony/Component/Messenger/Envelope.php
Copy file name to clipboardExpand all lines: src/Symfony/Component/Messenger/Envelope.php+16-2Lines changed: 16 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
26 | 26 | |
27 | 27 | |
28 | 28 | |
29 | | - |
| 29 | + |
| 30 | + |
30 | 31 | |
31 | | - |
| 32 | + |
32 | 33 | |
33 | 34 | |
34 | 35 | |
| ||
40 | 41 | |
41 | 42 | |
42 | 43 | |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
43 | 57 | |
44 | 58 | |
45 | 59 | |
|
Collapse file
src/Symfony/Component/Messenger/MessageBus.php
Copy file name to clipboardExpand all lines: src/Symfony/Component/Messenger/MessageBus.php+2-2Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
52 | 52 | |
53 | 53 | |
54 | 54 | |
55 | | - |
| 55 | + |
56 | 56 | |
57 | 57 | |
58 | 58 | |
59 | 59 | |
60 | | - |
| 60 | + |
61 | 61 | |
62 | 62 | |
63 | 63 | |
|
Collapse file
src/Symfony/Component/Messenger/MessageBusInterface.php
Copy file name to clipboardExpand all lines: src/Symfony/Component/Messenger/MessageBusInterface.php+5-2Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
11 | 11 | |
12 | 12 | |
13 | 13 | |
| 14 | + |
| 15 | + |
14 | 16 | |
15 | 17 | |
16 | 18 | |
| ||
21 | 23 | |
22 | 24 | |
23 | 25 | |
24 | | - |
| 26 | + |
| 27 | + |
25 | 28 | |
26 | | - |
| 29 | + |
27 | 30 | |
Collapse file
src/Symfony/Component/Messenger/RoutableMessageBus.php
Copy file name to clipboardExpand all lines: src/Symfony/Component/Messenger/RoutableMessageBus.php+2-2Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
37 | 37 | |
38 | 38 | |
39 | 39 | |
40 | | - |
| 40 | + |
41 | 41 | |
42 | 42 | |
43 | 43 | |
| ||
53 | 53 | |
54 | 54 | |
55 | 55 | |
56 | | - |
| 56 | + |
57 | 57 | |
58 | 58 | |
Collapse file
src/Symfony/Component/Messenger/Tests/EnvelopeTest.php
Copy file name to clipboardExpand all lines: src/Symfony/Component/Messenger/Tests/EnvelopeTest.php+22-3Lines changed: 22 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
26 | 26 | |
27 | 27 | |
28 | 28 | |
29 | | - |
| 29 | + |
30 | 30 | |
31 | 31 | |
32 | 32 | |
| ||
42 | 42 | |
43 | 43 | |
44 | 44 | |
45 | | - |
| 45 | + |
46 | 46 | |
47 | 47 | |
48 | 48 | |
| ||
53 | 53 | |
54 | 54 | |
55 | 55 | |
56 | | - |
| 56 | + |
57 | 57 | |
58 | 58 | |
59 | 59 | |
| ||
72 | 72 | |
73 | 73 | |
74 | 74 | |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | + |
75 | 94 | |
Collapse file
src/Symfony/Component/Messenger/Tests/HandleTraitTest.php
Copy file name to clipboardExpand all lines: src/Symfony/Component/Messenger/Tests/HandleTraitTest.php+3-3Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
31 | 31 | |
32 | 32 | |
33 | 33 | |
34 | | - |
| 34 | + |
35 | 35 | |
36 | 36 | |
37 | 37 | |
| ||
42 | 42 | |
43 | 43 | |
44 | 44 | |
45 | | - |
| 45 | + |
46 | 46 | |
47 | 47 | |
48 | 48 | |
| ||
74 | 74 | |
75 | 75 | |
76 | 76 | |
77 | | - |
| 77 | + |
78 | 78 | |
79 | 79 | |
80 | 80 | |
|
Collapse file
src/Symfony/Component/Messenger/Tests/MessageBusTest.php
Copy file name to clipboardExpand all lines: src/Symfony/Component/Messenger/Tests/MessageBusTest.php+17-3Lines changed: 17 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
16 | 16 | |
17 | 17 | |
18 | 18 | |
| 19 | + |
| 20 | + |
19 | 21 | |
20 | 22 | |
21 | 23 | |
| ||
69 | 71 | |
70 | 72 | |
71 | 73 | |
72 | | - |
| 74 | + |
73 | 75 | |
74 | 76 | |
75 | 77 | |
| ||
107 | 109 | |
108 | 110 | |
109 | 111 | |
110 | | - |
| 112 | + |
111 | 113 | |
112 | 114 | |
113 | | - |
| 115 | + |
114 | 116 | |
115 | 117 | |
116 | 118 | |
| ||
134 | 136 | |
135 | 137 | |
136 | 138 | |
| 139 | + |
| 140 | + |
| 141 | + |
| 142 | + |
| 143 | + |
| 144 | + |
| 145 | + |
| 146 | + |
| 147 | + |
| 148 | + |
| 149 | + |
| 150 | + |
137 | 151 | |
Collapse file
src/Symfony/Component/Messenger/Tests/Middleware/DispatchAfterCurrentBusMiddlewareTest.php
Copy file name to clipboardExpand all lines: src/Symfony/Component/Messenger/Tests/Middleware/DispatchAfterCurrentBusMiddlewareTest.php+4-4Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
44 | 44 | |
45 | 45 | |
46 | 46 | |
47 | | - |
48 | | - |
| 47 | + |
| 48 | + |
49 | 49 | |
50 | 50 | |
51 | 51 | |
| ||
80 | 80 | |
81 | 81 | |
82 | 82 | |
83 | | - |
84 | | - |
| 83 | + |
| 84 | + |
85 | 85 | |
86 | 86 | |
87 | 87 | |
|
Collapse file
src/Symfony/Component/Messenger/Tests/Middleware/SendMessageMiddlewareTest.php
Copy file name to clipboardExpand all lines: src/Symfony/Component/Messenger/Tests/Middleware/SendMessageMiddlewareTest.php+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
86 | 86 | |
87 | 87 | |
88 | 88 | |
89 | | - |
| 89 | + |
90 | 90 | |
91 | 91 | |
92 | 92 | |
|
0 commit comments