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

Unify the work of runnable services #860

Merged
merged 10 commits into from
Dec 23, 2022
Merged

Unify the work of runnable services #860

merged 10 commits into from
Dec 23, 2022

Conversation

xgreenx
Copy link
Collaborator

@xgreenx xgreenx commented Dec 21, 2022

Created a fuel-core-services crate to have common stuff of services.
Added initial implementation of ServiceRunner.
Used ServiceRunner to implement fuel_core_poa::Service. Removed fuel-core-bft from fuel-core because we don't use it now.

Added initial implementation of `ServiceRunner`.
Used `ServiceRunner` to implement `fuel_core_poa::Service`.
Removed `fuel-core-bft` from `fuel-core` because we don't use it now.
@xgreenx xgreenx requested a review from a team December 21, 2022 19:02
@xgreenx xgreenx self-assigned this Dec 21, 2022
Voxelot and others added 8 commits December 21, 2022 12:06
* Updated `TxPool` to use `ServiceRunner`.
Removed `RWLock` and replaced it with `ParkingMutex`.
Removed channels from `TxPool`.

Tests are broken

* Added first test

* Added several tests

* start refactoring trigger tests to use automock

* missing change

* Finally fixed tests for `PoA`.

* Used `fuel_core_services::BoxStream` as a return value for methods `next_transaction_status_update` and `next_gossiped_transaction`. Now those methods are sync and requires `&self` instead of `&mut self`.
Updated the code to work with those stream.

* move block importer events to stream.
rename next_* streaming methods to event.

* move stream re-exports under submodule

* fix re-export

Co-authored-by: Voxelot <brandonkite92@gmail.com>
@Voxelot Voxelot marked this pull request as ready for review December 23, 2022 03:00
@Voxelot Voxelot enabled auto-merge (squash) December 23, 2022 03:02
Copy link
Collaborator Author

@xgreenx xgreenx left a comment

Choose a reason for hiding this comment

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

Approve

@Voxelot Voxelot disabled auto-merge December 23, 2022 03:45
@Voxelot Voxelot merged commit e36389f into master Dec 23, 2022
@Voxelot Voxelot deleted the feature/service-runner branch December 23, 2022 04:11
xgreenx added a commit that referenced this pull request Jan 5, 2023
#875)

The final change of #860 epic.
Ref #809

Reworked `RunnableService` to be `RunnableService` and `RunnableTask`.
`RunnableService::initialize` replaced with the
`RunnableService::into_task` method. `into_task` returns a runnable task
that implements the `RunnableTask` trait. `into_task` may return another
type after initialization.

Updated all services to implement new traits. Implemented GraphQL
service via `ServiceRunner`. Extracted the graph QL logic into a
separate module(preparation to move this service into its own crate).

Re-used`ServiceRunner` for `FuelService`. Replaced `Modules` with
`SharedState` and `SubServices`.

Added a new `Starting` state of the service lifecycle. Added functions
to allow to await `Started` or `Stop` state.
crypto523 pushed a commit to crypto523/fuel-core that referenced this pull request Oct 7, 2024
…` (#875)

The final change of FuelLabs/fuel-core#860 epic.
Ref FuelLabs/fuel-core#809

Reworked `RunnableService` to be `RunnableService` and `RunnableTask`.
`RunnableService::initialize` replaced with the
`RunnableService::into_task` method. `into_task` returns a runnable task
that implements the `RunnableTask` trait. `into_task` may return another
type after initialization.

Updated all services to implement new traits. Implemented GraphQL
service via `ServiceRunner`. Extracted the graph QL logic into a
separate module(preparation to move this service into its own crate).

Re-used`ServiceRunner` for `FuelService`. Replaced `Modules` with
`SharedState` and `SubServices`.

Added a new `Starting` state of the service lifecycle. Added functions
to allow to await `Started` or `Stop` state.
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.

2 participants