ExecPool

An asset by z80
The page banner background of a mountain and forest
ExecPool hero image

Quick Information

0 ratings
ExecPool icon image
z80
ExecPool

Thread pool for asynchronous tasks execution. It runs tasks in a number of parallel threads. On each task completion it calls a callback specified.One can specify how many threads to use or use the default number which is OS.get_processor_count()-1.Usage example: ExecPool.start( my_object, "method_to_call", "callback_name" ).See "res://addons/exec_pool/examples/exec_pool_example.tscn" example scene.

Supported Engine Version
3.4
Version String
1.0.1
License Version
GPLv3
Support Level
community
Modified Date
1 year ago
Git URL
Issue URL

ExecPool

Gd-script ExecPool is made for asyncronous task execution.

You can limit number of threads it uses. The value is located in the resource file "res://addons/exec_pool/exec_pool_settings.tres" max_threads_qty. If the number is 0 or negative, OS.get_processors_numer() - 1 is used.

Typical usage

There are two options.

  1. Add ExecPool node to your scene tree.
  2. Or add ExecPool creation to "Project->Project Settings->AutoLoad".

There are 3 methods:

  1. ExecPool::start( object: Object, method_name: String, callback_name: String )
  2. ExecPool::start_with_arg( object: Object, method_name: String, callback_name: String, argument )
  3. ExecPool::start_with_args( object: Object, method_name: String, callback_name: String, arguments: Array )

for calling a method method_name in the object. After the method_name returns, the callback_name is called with the result returned by method_name. start_with_arg calls mathod method_name with an argument. "start_with_args" calls method method_name with an array of arguments.

See res://addons/exec_pool/examples/exec_pool_example.tscn for a usage example.

Thread pool for asynchronous tasks execution. It runs tasks in a number of parallel threads. On each task completion it calls a callback specified.

One can specify how many threads to use or use the default number which is OS.get_processor_count()-1.

Usage example: ExecPool.start( my_object, "method_to_call", "callback_name" ).

See "res://addons/exec_pool/examples/exec_pool_example.tscn" example scene.

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
ExecPool icon image
z80
ExecPool

Thread pool for asynchronous tasks execution. It runs tasks in a number of parallel threads. On each task completion it calls a callback specified.One can specify how many threads to use or use the default number which is OS.get_processor_count()-1.Usage example: ExecPool.start( my_object, "method_to_call", "callback_name" ).See "res://addons/exec_pool/examples/exec_pool_example.tscn" example scene.

Supported Engine Version
3.4
Version String
1.0.1
License Version
GPLv3
Support Level
community
Modified Date
1 year ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers