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
34f77642
Commit
34f77642
authored
Jun 24, 2017
by
yangxiaodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add summary comment.
parent
05125fc6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
6 deletions
+35
-6
Startup.cs
samples/Sample.Kafka/Startup.cs
+1
-1
CAP.AppBuilderExtensions.cs
src/DotNetCore.CAP/CAP.AppBuilderExtensions.cs
+3
-3
CAP.Builder.cs
src/DotNetCore.CAP/CAP.Builder.cs
+22
-2
CAP.Options.cs
src/DotNetCore.CAP/CAP.Options.cs
+9
-0
No files found.
samples/Sample.Kafka/Startup.cs
View file @
34f77642
...
@@ -38,7 +38,7 @@ namespace Sample.Kafka
...
@@ -38,7 +38,7 @@ namespace Sample.Kafka
app
.
UseMvc
();
app
.
UseMvc
();
app
.
UseC
onsistency
();
app
.
UseC
ap
();
}
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/CAP.AppBuilderExtensions.cs
View file @
34f77642
...
@@ -5,16 +5,16 @@ using Microsoft.Extensions.DependencyInjection;
...
@@ -5,16 +5,16 @@ using Microsoft.Extensions.DependencyInjection;
namespace
Microsoft.AspNetCore.Builder
namespace
Microsoft.AspNetCore.Builder
{
{
/// <summary>
/// <summary>
///
Consistence
extensions for <see cref="IApplicationBuilder"/>
///
app
extensions for <see cref="IApplicationBuilder"/>
/// </summary>
/// </summary>
public
static
class
AppBuilderExtensions
public
static
class
AppBuilderExtensions
{
{
///<summary>
///<summary>
/// Enables
Consistence
for the current application
/// Enables
cap
for the current application
/// </summary>
/// </summary>
/// <param name="app">The <see cref="IApplicationBuilder"/> instance this method extends.</param>
/// <param name="app">The <see cref="IApplicationBuilder"/> instance this method extends.</param>
/// <returns>The <see cref="IApplicationBuilder"/> instance this method extends.</returns>
/// <returns>The <see cref="IApplicationBuilder"/> instance this method extends.</returns>
public
static
IApplicationBuilder
UseC
onsistency
(
this
IApplicationBuilder
app
)
public
static
IApplicationBuilder
UseC
ap
(
this
IApplicationBuilder
app
)
{
{
if
(
app
==
null
)
if
(
app
==
null
)
{
{
...
...
src/DotNetCore.CAP/CAP.Builder.cs
View file @
34f77642
...
@@ -5,10 +5,13 @@ using DotNetCore.CAP.Job;
...
@@ -5,10 +5,13 @@ using DotNetCore.CAP.Job;
namespace
Microsoft.Extensions.DependencyInjection
namespace
Microsoft.Extensions.DependencyInjection
{
{
/// <summary>
/// <summary>
/// Used to verify
Consistency
service was called on a ServiceCollection
/// Used to verify
cap
service was called on a ServiceCollection
/// </summary>
/// </summary>
public
class
CapMarkerService
{
}
public
class
CapMarkerService
{
}
/// <summary>
/// Allows fine grained configuration of CAP services.
/// </summary>
public
class
CapBuilder
public
class
CapBuilder
{
{
public
CapBuilder
(
IServiceCollection
services
)
public
CapBuilder
(
IServiceCollection
services
)
...
@@ -16,14 +19,23 @@ namespace Microsoft.Extensions.DependencyInjection
...
@@ -16,14 +19,23 @@ namespace Microsoft.Extensions.DependencyInjection
Services
=
services
;
Services
=
services
;
}
}
/// <summary>
/// Gets the <see cref="IServiceCollection"/> where MVC services are configured.
/// </summary>
public
IServiceCollection
Services
{
get
;
private
set
;
}
public
IServiceCollection
Services
{
get
;
private
set
;
}
/// <summary>
/// Adds a scoped service of the type specified in serviceType with an implementation
/// </summary>
private
CapBuilder
AddScoped
(
Type
serviceType
,
Type
concreteType
)
private
CapBuilder
AddScoped
(
Type
serviceType
,
Type
concreteType
)
{
{
Services
.
AddScoped
(
serviceType
,
concreteType
);
Services
.
AddScoped
(
serviceType
,
concreteType
);
return
this
;
return
this
;
}
}
/// <summary>
/// Adds a singleton service of the type specified in serviceType with an implementation
/// </summary>
private
CapBuilder
AddSingleton
<
TService
,
TImplementation
>()
private
CapBuilder
AddSingleton
<
TService
,
TImplementation
>()
where
TService
:
class
where
TService
:
class
where
TImplementation
:
class
,
TService
where
TImplementation
:
class
,
TService
...
@@ -33,7 +45,7 @@ namespace Microsoft.Extensions.DependencyInjection
...
@@ -33,7 +45,7 @@ namespace Microsoft.Extensions.DependencyInjection
}
}
/// <summary>
/// <summary>
/// Add
s
an <see cref="ICapMessageStore"/> .
/// Add an <see cref="ICapMessageStore"/> .
/// </summary>
/// </summary>
/// <typeparam name="T">The type for the <see cref="ICapMessageStore"/> to add. </typeparam>
/// <typeparam name="T">The type for the <see cref="ICapMessageStore"/> to add. </typeparam>
/// <returns>The current <see cref="CapBuilder"/> instance.</returns>
/// <returns>The current <see cref="CapBuilder"/> instance.</returns>
...
@@ -43,12 +55,20 @@ namespace Microsoft.Extensions.DependencyInjection
...
@@ -43,12 +55,20 @@ namespace Microsoft.Extensions.DependencyInjection
return
AddScoped
(
typeof
(
ICapMessageStore
),
typeof
(
T
));
return
AddScoped
(
typeof
(
ICapMessageStore
),
typeof
(
T
));
}
}
/// <summary>
/// Add an <see cref="IJob"/> for process <see cref="CapJob"/>.
/// </summary>
/// <typeparam name="T">The type of the job.</typeparam>
public
virtual
CapBuilder
AddJobs
<
T
>()
public
virtual
CapBuilder
AddJobs
<
T
>()
where
T
:
class
,
IJob
where
T
:
class
,
IJob
{
{
return
AddSingleton
<
IJob
,
T
>();
return
AddSingleton
<
IJob
,
T
>();
}
}
/// <summary>
/// Add an <see cref="ICapProducerService"/>.
/// </summary>
/// <typeparam name="T">The type of the service.</typeparam>
public
virtual
CapBuilder
AddProducerService
<
T
>()
public
virtual
CapBuilder
AddProducerService
<
T
>()
where
T
:
class
,
ICapProducerService
where
T
:
class
,
ICapProducerService
{
{
...
...
src/DotNetCore.CAP/CAP.Options.cs
View file @
34f77642
...
@@ -7,10 +7,19 @@ namespace DotNetCore.CAP.Infrastructure
...
@@ -7,10 +7,19 @@ namespace DotNetCore.CAP.Infrastructure
/// </summary>
/// </summary>
public
class
CapOptions
public
class
CapOptions
{
{
/// <summary>
/// kafka or rabbitMQ brokers connection string.
/// </summary>
public
string
BrokerUrlList
{
get
;
set
;
}
=
"localhost:9092"
;
public
string
BrokerUrlList
{
get
;
set
;
}
=
"localhost:9092"
;
/// <summary>
/// Corn expression for configuring retry cron job. Default is 1 min.
/// </summary>
public
string
CronExp
{
get
;
set
;
}
=
Cron
.
Minutely
();
public
string
CronExp
{
get
;
set
;
}
=
Cron
.
Minutely
();
/// <summary>
/// Productor job polling delay time. Default is 8 sec.
/// </summary>
public
int
PollingDelay
{
get
;
set
;
}
=
8
;
public
int
PollingDelay
{
get
;
set
;
}
=
8
;
}
}
}
}
\ 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