-
Notifications
You must be signed in to change notification settings - Fork 18
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
Development of the concurrency control module for the new agent #39
Merged
TomasTurina
merged 9 commits into
master
from
enhancement/24-design-and-development-of-the-concurrency-control-module-for-the-new-agent
Jul 17, 2024
Merged
Development of the concurrency control module for the new agent #39
TomasTurina
merged 9 commits into
master
from
enhancement/24-design-and-development-of-the-concurrency-control-module-for-the-new-agent
Jul 17, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jr0me
force-pushed
the
enhancement/25-communicator-module-mvp
branch
from
July 16, 2024 15:40
a683b33
to
1b4137c
Compare
jr0me
force-pushed
the
enhancement/24-design-and-development-of-the-concurrency-control-module-for-the-new-agent
branch
from
July 17, 2024 05:58
aa7c114
to
1f1575d
Compare
jr0me
changed the base branch from
enhancement/25-communicator-module-mvp
to
master
July 17, 2024 05:58
This commit also defines the basic structure for the cmake project and its subcomponents. Test for each component should be built from the parent folder using the -DBUILD_TESTS=1 option. Inside the test folder a CMakeLists.txt file should define the sources to be build, but always expecting to be built from the parent CMake file.
jr0me
force-pushed
the
enhancement/24-design-and-development-of-the-concurrency-control-module-for-the-new-agent
branch
from
July 17, 2024 06:01
1f1575d
to
8df565f
Compare
jr0me
changed the title
Design and development of the concurrency control module for the new agent
Development of the concurrency control module for the new agent
Jul 17, 2024
Vcpkg as a submodule is introduced, the recommendation is to set the vcpkg toolchain before the first call to project(), due to some CMake requirements. This is because the toolchain is evaluated during the call to project().
This class should be the starting point for a class whose responsibility is going to be dealing with creating all the Agent related tasks. We aim at supporting both multithreading and coroutines as our concurrency model, but we allow to swap coroutines implementations by templating the awaitable type. Given the current status of the repository this will be momentarily in the agent folder, but it would be wise to move it to a separate cmake directory to hide the boost dependency for the implementation here provided.
This implementation uses boost asio io_context and awaitables. By enqueing either a callable object or an awaitable, we delegate to the io_context to schedule and manage the tasks within the pool.
jr0me
force-pushed
the
enhancement/24-design-and-development-of-the-concurrency-control-module-for-the-new-agent
branch
from
July 17, 2024 17:19
0b0ec46
to
1caf757
Compare
These are implemented as coroutines using boost asio and boost beast. Current implementation loops when resumed over a std::queue passed as reference and if not empty, sends the contents making a http request.
TomasTurina
approved these changes
Jul 17, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
TomasTurina
deleted the
enhancement/24-design-and-development-of-the-concurrency-control-module-for-the-new-agent
branch
July 17, 2024 20:57
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request introduces a foundational TaskManager class designed to meet the evolving needs of the Agent. The TaskManager can handle both thread-based and coroutine-based tasks, using Boost.Asio for asynchronous operations.
The class implements a generic interface, ITaskManager, allowing it to manage and execute tasks via an io_context. It supports enqueuing both standard function tasks and coroutine tasks, using boost::asio::co_spawn for the latter. This initial implementation serves as a starting point for developing a comprehensive task management system that will accommodate the Agent's future needs, integrating both threading and coroutine paradigms.