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

Rename task_id to group_id because WorkerThreadPool.wait_for_group_task_completion returns a grouped task #91983

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ra314
Copy link
Contributor

@ra314 ra314 commented May 15, 2024

Rename task_id to group_id to conform to the parameter name for WorkerThreadPool.wait_for_group_task_completion

Rename task_id to group_id to conform to the parameter name for WorkerThreadPool.wait_for_group_task_completion
@ra314 ra314 requested a review from a team as a code owner May 15, 2024 15:25
@AThousandShips
Copy link
Member

Please update the title to reflect what is being done

Also the c# code should be updated as well

I'm not sure about this though, the returned value is "group task ID" so it's more correct to call it a task id than a group id in my opinion, so if anything it should be group_task_id

@AThousandShips AThousandShips added this to the 4.x milestone May 15, 2024
@fire fire changed the title Update WorkerThreadPool.xml Rename task_id to group_id because WorkerThreadPool.wait_for_group_task_completion returns a grouped task May 15, 2024
@@ -74,15 +74,15 @@
</method>
<method name="get_group_processed_element_count" qualifiers="const">
<return type="int" />
<param index="0" name="group_id" type="int" />
<param index="0" name="group_task_id" type="int" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You used find/replace and replaced too much

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought this should be renamed.

"group task with the given ID" == "group_task_id", no?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No that's outside the scope of this, please restore, this is just for documentaiton

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the C# too, using groupTaskId

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be sure are these the changes you're looking for? (worker_thread_pool.cpp)

	ClassDB::bind_method(D_METHOD("is_group_task_completed", "group_task_id"), &WorkerThreadPool::is_group_task_completed);
	ClassDB::bind_method(D_METHOD("get_group_processed_element_count", "group_task_id"), &WorkerThreadPool::get_group_processed_element_count);
	ClassDB::bind_method(D_METHOD("wait_for_group_task_completion", "group_task_id"), &WorkerThreadPool::wait_for_group_task_completion);

I couldn't find any csharp files with group_id, groupId or groupTaskId.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No not at all, don't change these parts, just the documentation right here, this part:

		    long taskId = WorkerThreadPool.AddGroupTask(Callable.From&lt;int&gt;(ProcessEnemyAI), _enemies.Count);
		    // Other code...
		    WorkerThreadPool.WaitForGroupTaskCompletion(taskId);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants