Skip to content

Conversation

@oleksandr-nc
Copy link
Contributor

@oleksandr-nc oleksandr-nc commented Apr 8, 2025

Summary

Currently, external Task Processing providers (like those from AppAPI ExApps) might need to be loaded and registered on every request during AppAPI bootstrap, potentially impacting performance. This PR introduces an event-driven mechanism to allow the core Task Processing Manager to discover these providers on demand.

  1. New Event: Introduced OCP\TaskProcessing\Events\GetTaskProcessingProvidersEvent. This event is dispatched by the Manager when it needs to build the list of available providers and task types.

  2. A request-scoped static cache within dispatchGetProvidersEvent prevents redundant dispatching within the same request twice(fisrt time for Providers list and second time for custom TasksTypes list)

TODO

  • PR with use of this event in AppAPI repository

Checklist

@oleksandr-nc oleksandr-nc requested a review from a team as a code owner April 8, 2025 17:53
@oleksandr-nc oleksandr-nc requested review from artonge, icewind1991 and yemkareems and removed request for a team April 8, 2025 17:53
@oleksandr-nc oleksandr-nc force-pushed the fix/noid/taskprocessing-appapi branch from cc9d5e7 to 29d07ed Compare April 8, 2025 18:02
Copy link
Member

@marcelklehr marcelklehr left a comment

Choose a reason for hiding this comment

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

Can we extend the tests for this?

@oleksandr-nc oleksandr-nc force-pushed the fix/noid/taskprocessing-appapi branch from 29d07ed to 8468a4e Compare April 9, 2025 08:12
@oleksandr-nc
Copy link
Contributor Author

Can we extend the tests for this?

I think it might be more effective to place the integration tests in the AppAPI or ExApps repositories, where they can actually validate the Provider registration end-to-end. Mocking the tests here might not fully cover both parts of the system, and events system in the Nextcloud Server is already covered with tests.

@oleksandr-nc oleksandr-nc force-pushed the fix/noid/taskprocessing-appapi branch from 8468a4e to a639015 Compare April 9, 2025 11:47
…ders

Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
@oleksandr-nc oleksandr-nc force-pushed the fix/noid/taskprocessing-appapi branch from a639015 to c23ab0d Compare April 9, 2025 12:47
Copy link
Member

@marcelklehr marcelklehr left a comment

Choose a reason for hiding this comment

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

Thanks 💙

Copy link
Contributor

@kyteinsky kyteinsky left a comment

Choose a reason for hiding this comment

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

🚀

@oleksandr-nc oleksandr-nc merged commit 0a474e5 into master Apr 10, 2025
200 of 212 checks passed
@oleksandr-nc oleksandr-nc deleted the fix/noid/taskprocessing-appapi branch April 10, 2025 07:22
@oleksandr-nc
Copy link
Contributor Author

/backport to stable31

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants