From 34f77642f2c5eef04bece81fb39484194d83047a Mon Sep 17 00:00:00 2001 From: yangxiaodong Date: Sat, 24 Jun 2017 12:45:51 +0800 Subject: [PATCH] Add summary comment. --- samples/Sample.Kafka/Startup.cs | 2 +- .../CAP.AppBuilderExtensions.cs | 6 ++--- src/DotNetCore.CAP/CAP.Builder.cs | 24 +++++++++++++++++-- src/DotNetCore.CAP/CAP.Options.cs | 9 +++++++ 4 files changed, 35 insertions(+), 6 deletions(-) diff --git a/samples/Sample.Kafka/Startup.cs b/samples/Sample.Kafka/Startup.cs index be0c759..6cdc56f 100644 --- a/samples/Sample.Kafka/Startup.cs +++ b/samples/Sample.Kafka/Startup.cs @@ -38,7 +38,7 @@ namespace Sample.Kafka app.UseMvc(); - app.UseConsistency(); + app.UseCap(); } } } \ No newline at end of file diff --git a/src/DotNetCore.CAP/CAP.AppBuilderExtensions.cs b/src/DotNetCore.CAP/CAP.AppBuilderExtensions.cs index 897d27d..b5ebb1e 100644 --- a/src/DotNetCore.CAP/CAP.AppBuilderExtensions.cs +++ b/src/DotNetCore.CAP/CAP.AppBuilderExtensions.cs @@ -5,16 +5,16 @@ using Microsoft.Extensions.DependencyInjection; namespace Microsoft.AspNetCore.Builder { /// - /// Consistence extensions for + /// app extensions for /// public static class AppBuilderExtensions { /// - /// Enables Consistence for the current application + /// Enables cap for the current application /// /// The instance this method extends. /// The instance this method extends. - public static IApplicationBuilder UseConsistency(this IApplicationBuilder app) + public static IApplicationBuilder UseCap(this IApplicationBuilder app) { if (app == null) { diff --git a/src/DotNetCore.CAP/CAP.Builder.cs b/src/DotNetCore.CAP/CAP.Builder.cs index 1273582..f1d254f 100644 --- a/src/DotNetCore.CAP/CAP.Builder.cs +++ b/src/DotNetCore.CAP/CAP.Builder.cs @@ -5,10 +5,13 @@ using DotNetCore.CAP.Job; namespace Microsoft.Extensions.DependencyInjection { /// - /// Used to verify Consistency service was called on a ServiceCollection + /// Used to verify cap service was called on a ServiceCollection /// public class CapMarkerService { } + /// + /// Allows fine grained configuration of CAP services. + /// public class CapBuilder { public CapBuilder(IServiceCollection services) @@ -16,14 +19,23 @@ namespace Microsoft.Extensions.DependencyInjection Services = services; } + /// + /// Gets the where MVC services are configured. + /// public IServiceCollection Services { get; private set; } + /// + /// Adds a scoped service of the type specified in serviceType with an implementation + /// private CapBuilder AddScoped(Type serviceType, Type concreteType) { Services.AddScoped(serviceType, concreteType); return this; } + /// + /// Adds a singleton service of the type specified in serviceType with an implementation + /// private CapBuilder AddSingleton() where TService : class where TImplementation : class, TService @@ -33,7 +45,7 @@ namespace Microsoft.Extensions.DependencyInjection } /// - /// Adds an . + /// Add an . /// /// The type for the to add. /// The current instance. @@ -43,12 +55,20 @@ namespace Microsoft.Extensions.DependencyInjection return AddScoped(typeof(ICapMessageStore), typeof(T)); } + /// + /// Add an for process . + /// + /// The type of the job. public virtual CapBuilder AddJobs() where T : class, IJob { return AddSingleton(); } + /// + /// Add an . + /// + /// The type of the service. public virtual CapBuilder AddProducerService() where T : class, ICapProducerService { diff --git a/src/DotNetCore.CAP/CAP.Options.cs b/src/DotNetCore.CAP/CAP.Options.cs index c1c24f9..e0c5801 100644 --- a/src/DotNetCore.CAP/CAP.Options.cs +++ b/src/DotNetCore.CAP/CAP.Options.cs @@ -7,10 +7,19 @@ namespace DotNetCore.CAP.Infrastructure /// public class CapOptions { + /// + /// kafka or rabbitMQ brokers connection string. + /// public string BrokerUrlList { get; set; } = "localhost:9092"; + /// + /// Corn expression for configuring retry cron job. Default is 1 min. + /// public string CronExp { get; set; } = Cron.Minutely(); + /// + /// Productor job polling delay time. Default is 8 sec. + /// public int PollingDelay { get; set; } = 8; } } \ No newline at end of file