Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
CAP
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
CAP
Commits
1e847fad
Commit
1e847fad
authored
Apr 15, 2018
by
Liuhaoyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor IBootService
parent
07107922
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
9 deletions
+9
-9
IBootService.cs
src/SkyWalking.Abstractions/Boot/IBootService.cs
+2
-0
ServiceManager.cs
src/SkyWalking.Core/Boot/ServiceManager.cs
+3
-6
TimerService.cs
src/SkyWalking.Core/Boot/TimerService.cs
+2
-0
SamplingService.cs
src/SkyWalking.Core/Sampling/SamplingService.cs
+2
-0
SkyWalking.Core.csproj
src/SkyWalking.Core/SkyWalking.Core.csproj
+0
-3
No files found.
src/SkyWalking.Abstractions/Boot/IBootService.cs
View file @
1e847fad
...
@@ -24,6 +24,8 @@ namespace SkyWalking.Boot
...
@@ -24,6 +24,8 @@ namespace SkyWalking.Boot
{
{
public
interface
IBootService
:
IDisposable
public
interface
IBootService
:
IDisposable
{
{
int
Order
{
get
;
}
Task
Initialize
(
CancellationToken
token
);
Task
Initialize
(
CancellationToken
token
);
}
}
}
}
\ No newline at end of file
src/SkyWalking.Core/Boot/ServiceManager.cs
View file @
1e847fad
...
@@ -58,13 +58,10 @@ namespace SkyWalking.Boot
...
@@ -58,13 +58,10 @@ namespace SkyWalking.Boot
public
async
Task
Initialize
()
public
async
Task
Initialize
()
{
{
var
types
=
FindServiceTypes
();
var
types
=
FindServiceTypes
();
foreach
(
var
type
in
types
)
foreach
(
var
service
in
types
.
Select
(
Activator
.
CreateInstance
).
OfType
<
IBootService
>().
OrderBy
(
x
=>
x
.
Order
)
)
{
{
if
(
Activator
.
CreateInstance
(
type
)
is
IBootService
service
)
await
service
.
Initialize
(
_tokenSource
.
Token
);
{
_services
.
Add
(
service
.
GetType
(),
service
);
await
service
.
Initialize
(
_tokenSource
.
Token
);
_services
.
Add
(
type
,
service
);
}
}
}
}
}
...
...
src/SkyWalking.Core/Boot/TimerService.cs
View file @
1e847fad
...
@@ -31,6 +31,8 @@ namespace SkyWalking.Boot
...
@@ -31,6 +31,8 @@ namespace SkyWalking.Boot
{
{
}
}
public
virtual
int
Order
{
get
;
}
=
2
;
public
async
Task
Initialize
(
CancellationToken
token
)
public
async
Task
Initialize
(
CancellationToken
token
)
{
{
await
Initializing
(
token
);
await
Initializing
(
token
);
...
...
src/SkyWalking.Core/Sampling/SamplingService.cs
View file @
1e847fad
...
@@ -37,6 +37,8 @@ namespace SkyWalking.Sampling
...
@@ -37,6 +37,8 @@ namespace SkyWalking.Sampling
{
{
}
}
public
int
Order
{
get
;
}
=
1
;
public
Task
Initialize
(
CancellationToken
token
)
public
Task
Initialize
(
CancellationToken
token
)
{
{
return
Task
.
CompletedTask
;
return
Task
.
CompletedTask
;
...
...
src/SkyWalking.Core/SkyWalking.Core.csproj
View file @
1e847fad
...
@@ -14,7 +14,4 @@
...
@@ -14,7 +14,4 @@
<ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SkyWalking.Abstractions\SkyWalking.Abstractions.csproj" />
<ProjectReference Include="..\SkyWalking.Abstractions\SkyWalking.Abstractions.csproj" />
</ItemGroup>
</ItemGroup>
<ItemGroup>
<Folder Include="Remote" />
</ItemGroup>
</Project>
</Project>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment