@parallelize and @task

When to use?
Sorry for the noob question, but I can't seem to find the answer in the searches.

Some agents use @parallelize and @task, I assume to allow and agent to run queries in separate threads, but I'm not sure when it would make sense to use it. Is there a rule of thumb about which operations should be parallelized?

If an agent fetches local metadata, does it even need this? Will the media server call the agent for every file, or is it preferred that the agent tries to update metadata for as many files as it can (say, by scanning a directory)?

Thanks to all.

I found the answer, in case anyone else is looking for it.



From the framework.bundle:



The @parallelize and @task decorators are designed to be used in conjunction with each other -

@parallelize decorates a function that defines one or more @task functions. A ThreadKit-specific

lock is maintained so only one parallelizer can be created at any time. When the parallelizer

has run, the tasks are queued for dispatch to the runtime’s task pool, and the calling thread is

blocked until all tasks have completed.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.