Skip to content

Commit 05fab5b

Browse files
committed
add reset method to support consecutive consume/start calls
fix #244
1 parent 3dd1b63 commit 05fab5b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

RabbitMq/BaseConsumer.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,13 @@ public function getIdleTimeout()
9797
{
9898
return $this->idleTimeout;
9999
}
100+
101+
/**
102+
* Resets the consumed property.
103+
* Use when you want to call start() or consume() multiple times.
104+
*/
105+
public function resetConsumed()
106+
{
107+
$this->consumed = 0;
108+
}
100109
}

0 commit comments

Comments
 (0)