Skip to content

Delay logic broken by parallel batching in InternalState #1695

@ghost

Description

The startBroadcast method currently batches requests in groups of 50 using await($promises). However, the delay($this->delay) call is located inside the async closure.

if ($this->delay !== null) {

When the loop executes, 50 async tasks are scheduled almost immediately. If $this->delay is set (e.g., 5 seconds), all 50 tasks sleep concurrently and then wake up at the exact same time to send their messages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions