Thread vs Worker

What is the difference between thread and worker in temporal.io java SDK?
Does worker having under the hood some thread pool ?
Does it mean that one worker = one thread ?

See the worker documentation for details. Let us know if you have any specific questions.

1 Like

Thanks for the answer
I have many long running activities which run in parallel using Promise , in that case should I create as many Workers as running activities?

A single worker can support many parallel activities. The maximum number of parallel activities is defined through WorkerOptions.MaxConcurrentActivityExecutionSize property. Internally these activities are executed by a thread pool with the maximum size set to the configured value. You can also implement activities asynchronously using manual completion.

1 Like

Thanks a lot