@@ -36,20 +36,20 @@ final class MessengerListener
3636 * This allows us to have breadcrumbs only for one message and no breadcrumb is leaked into
3737 * future messages.
3838 */
39- private $ resetBreadcrumbs ;
39+ private $ isolateBreadcrumbsByMessage ;
4040
4141 /**
42- * @param HubInterface $hub The current hub
43- * @param bool $captureSoftFails Whether to capture errors thrown
44- * while processing a message that
45- * will be retried
46- * @param bool $resetBreadcrumbs Whether to reset all breadcrumbs after a message
42+ * @param HubInterface $hub The current hub
43+ * @param bool $captureSoftFails Whether to capture errors thrown
44+ * while processing a message that
45+ * will be retried
46+ * @param bool $isolateBreadcrumbsByMessage Whether to reset all breadcrumbs after a message
4747 */
48- public function __construct (HubInterface $ hub , bool $ captureSoftFails = true , bool $ resetBreadcrumbs = false )
48+ public function __construct (HubInterface $ hub , bool $ captureSoftFails = true , bool $ isolateBreadcrumbsByMessage = false )
4949 {
5050 $ this ->hub = $ hub ;
5151 $ this ->captureSoftFails = $ captureSoftFails ;
52- $ this ->resetBreadcrumbs = $ resetBreadcrumbs ;
52+ $ this ->isolateBreadcrumbsByMessage = $ isolateBreadcrumbsByMessage ;
5353 }
5454
5555 /**
@@ -85,7 +85,7 @@ public function handleWorkerMessageFailedEvent(WorkerMessageFailedEvent $event):
8585 } finally {
8686 // We always want to pop the scope at the end of this method to add the breadcrumbs
8787 // to any potential event that is produced.
88- if ($ this ->resetBreadcrumbs ) {
88+ if ($ this ->isolateBreadcrumbsByMessage ) {
8989 $ this ->hub ->popScope ();
9090 }
9191 }
@@ -101,7 +101,7 @@ public function handleWorkerMessageHandledEvent(WorkerMessageHandledEvent $event
101101 // Flush normally happens at shutdown... which only happens in the worker if it is run with a lifecycle limit
102102 // such as --time=X or --limit=Y. Flush immediately in a background worker.
103103 $ this ->flushClient ();
104- if ($ this ->resetBreadcrumbs ) {
104+ if ($ this ->isolateBreadcrumbsByMessage ) {
105105 $ this ->hub ->popScope ();
106106 }
107107 }
@@ -116,7 +116,7 @@ public function handleWorkerMessageHandledEvent(WorkerMessageHandledEvent $event
116116 */
117117 public function handleWorkerMessageReceivedEvent (WorkerMessageReceivedEvent $ event ): void
118118 {
119- if ($ this ->resetBreadcrumbs ) {
119+ if ($ this ->isolateBreadcrumbsByMessage ) {
120120 $ this ->hub ->pushScope ();
121121 }
122122 }
0 commit comments