Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
3.4.1
=====

* (improvement) Return task uuid from task manager.


3.4.0
=====

Expand Down
7 changes: 4 additions & 3 deletions src/Manager/TaskManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ public function __construct (
*
* @param StampInterface[] $stamps
*
* @return bool whether the message was added. If this is false, an identical job is already queued.
* @return string The uuid of the task
*
* @api
*/
public function enqueue (Task $task, array $stamps = []) : bool
public function enqueue (Task $task, array $stamps = []) : string
{
$uniqueTaskId = $task->getMetaData()->uniqueTaskId;

Expand All @@ -40,7 +40,8 @@ public function enqueue (Task $task, array $stamps = []) : bool
new Envelope($task, $stamps),
);

return true;
/** @phpstan-ignore-next-line property.deprecated (The uuid integration will be refactored in v4) */
return $task->ulid;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/Manager/TaskManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function testEnqueueWithoutUniqueTaskIdAlwaysDispatches () : void
$manager = $this->createManager(["queue" => $this->createListableTransport()], $bus);
$task = $this->createTask(null);

self::assertTrue($manager->enqueue($task));
self::assertIsString($manager->enqueue($task));
}

public function testEnqueueReturnsTrueWhenNoConflict () : void
Expand All @@ -107,7 +107,7 @@ public function testEnqueueReturnsTrueWhenNoConflict () : void

$manager = $this->createManager(["queue" => $this->createListableTransport()], $bus);

self::assertTrue($manager->enqueue($this->createTask("test.task")));
self::assertIsString($manager->enqueue($this->createTask("test.task")));
}

public function testEnqueueReturnsFalseWhenDuplicateInQueue () : void
Expand Down
Loading