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
8bfd066f
Commit
8bfd066f
authored
Nov 24, 2017
by
Savorboard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add get all topics
parent
b418aeb5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletion
+23
-1
MethodMatcherCache.cs
src/DotNetCore.CAP/Internal/MethodMatcherCache.cs
+23
-1
No files found.
src/DotNetCore.CAP/Internal/MethodMatcherCache.cs
View file @
8bfd066f
...
@@ -2,13 +2,13 @@
...
@@ -2,13 +2,13 @@
using
System.Collections.Concurrent
;
using
System.Collections.Concurrent
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
DotNetCore.CAP.Abstractions
;
namespace
DotNetCore.CAP.Internal
namespace
DotNetCore.CAP.Internal
{
{
internal
class
MethodMatcherCache
internal
class
MethodMatcherCache
{
{
private
readonly
IConsumerServiceSelector
_selector
;
private
readonly
IConsumerServiceSelector
_selector
;
private
List
<
string
>
_allTopics
;
public
MethodMatcherCache
(
IConsumerServiceSelector
selector
)
public
MethodMatcherCache
(
IConsumerServiceSelector
selector
)
{
{
...
@@ -54,5 +54,27 @@ namespace DotNetCore.CAP.Internal
...
@@ -54,5 +54,27 @@ namespace DotNetCore.CAP.Internal
}
}
return
dic
;
return
dic
;
}
}
/// <summary>
/// Get all subscribe topics name.
/// </summary>
public
IEnumerable
<
string
>
GetSubscribeTopics
()
{
if
(
_allTopics
!=
null
)
{
return
_allTopics
;
}
if
(
Entries
==
null
)
throw
new
ArgumentNullException
(
nameof
(
Entries
));
_allTopics
=
new
List
<
string
>();
foreach
(
var
descriptors
in
Entries
.
Values
)
{
_allTopics
.
AddRange
(
descriptors
.
Select
(
x
=>
x
.
Attribute
.
Name
));
}
return
_allTopics
;
}
}
}
}
}
\ 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