Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🧹 CHORE]: Possibility to disable activity workers #2089

Closed
1 task done
cv65kr opened this issue Dec 11, 2024 · 1 comment
Closed
1 task done

[🧹 CHORE]: Possibility to disable activity workers #2089

cv65kr opened this issue Dec 11, 2024 · 1 comment
Assignees
Labels
C-enhancement Category: enhancement. Meaning improvements of current module, transport, etc..
Milestone

Comments

@cv65kr
Copy link
Member

cv65kr commented Dec 11, 2024

No duplicates 🥲.

  • I have searched for a similar issue.

What should be improved or cleaned up?

I have a case where we don't need activities, let's consider it as a workflow:

#[WorkflowInterface]
class Workflow
{
    private Data $data;
    private bool $signal = false;
    
    private Statistics $statistics;
    
    #[WorkflowMethod(name: 'Test')]
    public function run()
    {
        while (true) {
            yield Workflow::awaitWithTimeout(CarbonInterval::minutes(35), fn () => $this->signal);
            $this->signal = false;
            
            // Do some operations
            $this->statistics = new Statistics(); // Output of operations
            
            // Continue as new
        }
    }

    #[SignalMethod]
    public function register(array $data): void
    {
        $this->data->add($data);
        $this->signal = true;
    }

    #[QueryMethod]
    public function statistics(): Statistics
    {
        return $this->statistics;
    }
}

So in general we are calculating and aggregating signals and returns statistics.

In this particular case we need only workflow worker in temporal plugin.

If you set up 0 activity workers it will set up 5 one.

To save resources and avoid unused activity workers, would be nice to have possibility to disable activity workers.

@cv65kr cv65kr added the C-enhancement Category: enhancement. Meaning improvements of current module, transport, etc.. label Dec 11, 2024
@cv65kr cv65kr changed the title [🧹 CHORE]: Possibility to set up zero activity workers [🧹 CHORE]: Possibility to disable activity workers Dec 11, 2024
@rustatian
Copy link
Member

Hey @cv65kr 👋🏻
Yeah, it makes sense 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: enhancement. Meaning improvements of current module, transport, etc..
Projects
Status: ✅ Done
Development

No branches or pull requests

2 participants