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
819c4465
Commit
819c4465
authored
Jul 17, 2017
by
yangxiaodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup code.
parent
821544b2
Changes
45
Show whitespace changes
Inline
Side-by-side
Showing
45 changed files
with
123 additions
and
166 deletions
+123
-166
CAP.EFOptions.cs
src/DotNetCore.CAP.EntityFrameworkCore/CAP.EFOptions.cs
+1
-3
CAP.SqlServerCapOptionsExtension.cs
...P.EntityFrameworkCore/CAP.SqlServerCapOptionsExtension.cs
+1
-1
CAP.SqlServerOptions.cs
...otNetCore.CAP.EntityFrameworkCore/CAP.SqlServerOptions.cs
+2
-8
CapPublisher.cs
src/DotNetCore.CAP.EntityFrameworkCore/CapPublisher.cs
+1
-1
FetchedMessage.cs
src/DotNetCore.CAP.EntityFrameworkCore/FetchedMessage.cs
+2
-5
IAdditionalProcessor.Default.cs
...e.CAP.EntityFrameworkCore/IAdditionalProcessor.Default.cs
+3
-6
SqlServerFetchedMessage.cs
...etCore.CAP.EntityFrameworkCore/SqlServerFetchedMessage.cs
+1
-4
SqlServerStorage.cs
src/DotNetCore.CAP.EntityFrameworkCore/SqlServerStorage.cs
+3
-4
CAP.KafkaCapOptionsExtension.cs
src/DotNetCore.CAP.Kafka/CAP.KafkaCapOptionsExtension.cs
+1
-1
CAP.KafkaOptions.cs
src/DotNetCore.CAP.Kafka/CAP.KafkaOptions.cs
+2
-2
CAP.Options.Extensions.cs
src/DotNetCore.CAP.Kafka/CAP.Options.Extensions.cs
+0
-1
KafkaConsumerClient.cs
src/DotNetCore.CAP.Kafka/KafkaConsumerClient.cs
+0
-1
PublishQueueExecutor.cs
src/DotNetCore.CAP.Kafka/PublishQueueExecutor.cs
+1
-1
CAP.RabbiMQOptions.cs
src/DotNetCore.CAP.RabbitMQ/CAP.RabbiMQOptions.cs
+1
-1
CAP.RabbitMQCapOptionsExtension.cs
...otNetCore.CAP.RabbitMQ/CAP.RabbitMQCapOptionsExtension.cs
+1
-1
CapSubscribeAttribute.cs
src/DotNetCore.CAP.RabbitMQ/CapSubscribeAttribute.cs
+0
-1
PublishQueueExecutor.cs
src/DotNetCore.CAP.RabbitMQ/PublishQueueExecutor.cs
+1
-2
IModelBinder.cs
src/DotNetCore.CAP/Abstractions/ModelBinding/IModelBinder.cs
+1
-1
CAP.Options.cs
src/DotNetCore.CAP/CAP.Options.cs
+0
-1
CAP.ServiceCollectionExtensions.cs
src/DotNetCore.CAP/CAP.ServiceCollectionExtensions.cs
+2
-2
ICapOptionsExtension.cs
src/DotNetCore.CAP/ICapOptionsExtension.cs
+1
-1
ICapPublisher.cs
src/DotNetCore.CAP/ICapPublisher.cs
+2
-3
IConsumerHandler.Default.cs
src/DotNetCore.CAP/IConsumerHandler.Default.cs
+0
-1
IQueueExecutor.cs
src/DotNetCore.CAP/IQueueExecutor.cs
+2
-5
IStorage.cs
src/DotNetCore.CAP/IStorage.cs
+11
-11
IStorageTransaction.cs
src/DotNetCore.CAP/IStorageTransaction.cs
+9
-9
Helper.cs
src/DotNetCore.CAP/Infrastructure/Helper.cs
+1
-1
StatusName.cs
src/DotNetCore.CAP/Infrastructure/StatusName.cs
+2
-6
WaitHandleEx.cs
src/DotNetCore.CAP/Infrastructure/WaitHandleEx.cs
+1
-1
IConsumerServiceSelector.Default.cs
...tNetCore.CAP/Internal/IConsumerServiceSelector.Default.cs
+0
-1
MethodMatcherCache.cs
src/DotNetCore.CAP/Internal/MethodMatcherCache.cs
+2
-2
ObjectMethodExecutor.cs
src/DotNetCore.CAP/Internal/ObjectMethodExecutor.cs
+3
-3
SubscriberNotFoundException.cs
src/DotNetCore.CAP/Internal/SubscriberNotFoundException.cs
+10
-4
LoggerExtensions.cs
src/DotNetCore.CAP/LoggerExtensions.cs
+0
-7
CapPublishedMessage.cs
src/DotNetCore.CAP/Models/CapPublishedMessage.cs
+2
-2
CapQueue.cs
src/DotNetCore.CAP/Models/CapQueue.cs
+1
-1
MessageType.cs
src/DotNetCore.CAP/Models/MessageType.cs
+1
-1
OperateResult.cs
src/DotNetCore.CAP/OperateResult.cs
+2
-2
IAdditionalProcessor.cs
src/DotNetCore.CAP/Processor/IAdditionalProcessor.cs
+2
-7
IDispatcher.Default.cs
src/DotNetCore.CAP/Processor/IDispatcher.Default.cs
+1
-1
IDispatcher.cs
src/DotNetCore.CAP/Processor/IDispatcher.cs
+2
-6
IProcessor.PublishQueuer.cs
src/DotNetCore.CAP/Processor/IProcessor.PublishQueuer.cs
+38
-38
IProcessor.SubscribeQueuer.cs
src/DotNetCore.CAP/Processor/IProcessor.SubscribeQueuer.cs
+2
-2
RetryBehavior.cs
src/DotNetCore.CAP/Processor/RetryBehavior.cs
+1
-1
QueueExecutorFactory.cs
src/DotNetCore.CAP/QueueExecutorFactory.cs
+3
-3
No files found.
src/DotNetCore.CAP.EntityFrameworkCore/CAP.EFOptions.cs
View file @
819c4465
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
DotNetCore.CAP
namespace
DotNetCore.CAP
{
{
...
...
src/DotNetCore.CAP.EntityFrameworkCore/CAP.SqlServerCapOptionsExtension.cs
View file @
819c4465
src/DotNetCore.CAP.EntityFrameworkCore/CAP.SqlServerOptions.cs
View file @
819c4465
using
System
;
namespace
DotNetCore.CAP
using
System.Collections.Generic
;
using
System.Text
;
using
DotNetCore.CAP.EntityFrameworkCore
;
namespace
DotNetCore.CAP
{
{
public
class
SqlServerOptions
:
EFOptions
public
class
SqlServerOptions
:
EFOptions
{
{
...
@@ -11,6 +6,5 @@ namespace DotNetCore.CAP
...
@@ -11,6 +6,5 @@ namespace DotNetCore.CAP
/// Gets or sets the database's connection string that will be used to store database entities.
/// Gets or sets the database's connection string that will be used to store database entities.
/// </summary>
/// </summary>
public
string
ConnectionString
{
get
;
set
;
}
//= "Server=DESKTOP-M9R8T31;Initial Catalog=Test;User Id=sa;Password=P@ssw0rd;MultipleActiveResultSets=True";
public
string
ConnectionString
{
get
;
set
;
}
//= "Server=DESKTOP-M9R8T31;Initial Catalog=Test;User Id=sa;Password=P@ssw0rd;MultipleActiveResultSets=True";
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP.EntityFrameworkCore/CapPublisher.cs
View file @
819c4465
src/DotNetCore.CAP.EntityFrameworkCore/FetchedMessage.cs
View file @
819c4465
using
System
;
using
DotNetCore.CAP.Models
;
using
System.Collections.Generic
;
using
System.Text
;
using
DotNetCore.CAP.Models
;
namespace
DotNetCore.CAP.EntityFrameworkCore
namespace
DotNetCore.CAP.EntityFrameworkCore
{
{
...
...
src/DotNetCore.CAP.EntityFrameworkCore/IAdditionalProcessor.Default.cs
View file @
819c4465
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Data.SqlClient
;
using
System.Data.SqlClient
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
Dapper
;
using
Dapper
;
using
DotNetCore.CAP.Processor
;
using
DotNetCore.CAP.Processor
;
using
Microsoft.Extensions.DependencyInjection
;
using
Microsoft.Extensions.Logging
;
using
Microsoft.Extensions.Logging
;
namespace
DotNetCore.CAP.EntityFrameworkCore
namespace
DotNetCore.CAP.EntityFrameworkCore
...
@@ -44,7 +41,7 @@ namespace DotNetCore.CAP.EntityFrameworkCore
...
@@ -44,7 +41,7 @@ namespace DotNetCore.CAP.EntityFrameworkCore
var
removedCount
=
0
;
var
removedCount
=
0
;
do
do
{
{
using
(
var
connection
=
new
SqlConnection
(
_options
.
ConnectionString
))
using
(
var
connection
=
new
SqlConnection
(
_options
.
ConnectionString
))
{
{
removedCount
=
await
connection
.
ExecuteAsync
(
$@"
removedCount
=
await
connection
.
ExecuteAsync
(
$@"
DELETE TOP (@count)
DELETE TOP (@count)
...
...
src/DotNetCore.CAP.EntityFrameworkCore/SqlServerFetchedMessage.cs
View file @
819c4465
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Data
;
using
System.Data
;
using
System.Text
;
using
System.Threading
;
using
System.Threading
;
using
Dapper
;
using
Dapper
;
using
DotNetCore.CAP.Models
;
using
DotNetCore.CAP.Models
;
using
Microsoft.EntityFrameworkCore.Storage
;
namespace
DotNetCore.CAP.EntityFrameworkCore
namespace
DotNetCore.CAP.EntityFrameworkCore
{
{
...
...
src/DotNetCore.CAP.EntityFrameworkCore/SqlServerStorage.cs
View file @
819c4465
...
@@ -43,7 +43,6 @@ namespace DotNetCore.CAP.EntityFrameworkCore
...
@@ -43,7 +43,6 @@ namespace DotNetCore.CAP.EntityFrameworkCore
protected
virtual
string
CreateDbTablesScript
(
string
schema
)
protected
virtual
string
CreateDbTablesScript
(
string
schema
)
{
{
var
batchSQL
=
var
batchSQL
=
$@"
$@"
IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name = '
{
schema
}
')
IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name = '
{
schema
}
')
...
...
src/DotNetCore.CAP.Kafka/CAP.KafkaCapOptionsExtension.cs
View file @
819c4465
src/DotNetCore.CAP.Kafka/CAP.KafkaOptions.cs
View file @
819c4465
src/DotNetCore.CAP.Kafka/CAP.Options.Extensions.cs
View file @
819c4465
using
System
;
using
System
;
using
DotNetCore.CAP
;
using
DotNetCore.CAP
;
using
DotNetCore.CAP.Kafka
;
namespace
Microsoft.Extensions.DependencyInjection
namespace
Microsoft.Extensions.DependencyInjection
{
{
...
...
src/DotNetCore.CAP.Kafka/KafkaConsumerClient.cs
View file @
819c4465
...
@@ -81,7 +81,6 @@ namespace DotNetCore.CAP.Kafka
...
@@ -81,7 +81,6 @@ namespace DotNetCore.CAP.Kafka
MessageReceieved
?.
Invoke
(
sender
,
message
);
MessageReceieved
?.
Invoke
(
sender
,
message
);
}
}
#
endregion
private
methods
#
endregion
private
methods
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP.Kafka/PublishQueueExecutor.cs
View file @
819c4465
src/DotNetCore.CAP.RabbitMQ/CAP.RabbiMQOptions.cs
View file @
819c4465
src/DotNetCore.CAP.RabbitMQ/CAP.RabbitMQCapOptionsExtension.cs
View file @
819c4465
src/DotNetCore.CAP.RabbitMQ/CapSubscribeAttribute.cs
View file @
819c4465
...
@@ -6,7 +6,6 @@ namespace DotNetCore.CAP.RabbitMQ
...
@@ -6,7 +6,6 @@ namespace DotNetCore.CAP.RabbitMQ
{
{
public
CapSubscribeAttribute
(
string
name
)
:
base
(
name
)
public
CapSubscribeAttribute
(
string
name
)
:
base
(
name
)
{
{
}
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP.RabbitMQ/PublishQueueExecutor.cs
View file @
819c4465
...
@@ -64,7 +64,6 @@ namespace DotNetCore.CAP.RabbitMQ
...
@@ -64,7 +64,6 @@ namespace DotNetCore.CAP.RabbitMQ
Description
=
ex
.
Message
Description
=
ex
.
Message
}));
}));
}
}
}
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Abstractions/ModelBinding/IModelBinder.cs
View file @
819c4465
src/DotNetCore.CAP/CAP.Options.cs
View file @
819c4465
...
@@ -35,7 +35,6 @@ namespace DotNetCore.CAP
...
@@ -35,7 +35,6 @@ namespace DotNetCore.CAP
/// </summary>
/// </summary>
public
int
PollingDelay
{
get
;
set
;
}
=
8
;
public
int
PollingDelay
{
get
;
set
;
}
=
8
;
/// <summary>
/// <summary>
/// Registers an extension that will be executed when building services.
/// Registers an extension that will be executed when building services.
/// </summary>
/// </summary>
...
...
src/DotNetCore.CAP/CAP.ServiceCollectionExtensions.cs
View file @
819c4465
src/DotNetCore.CAP/ICapOptionsExtension.cs
View file @
819c4465
src/DotNetCore.CAP/ICapPublisher.cs
View file @
819c4465
using
System
;
using
System.Data
;
using
System.Data
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
namespace
DotNetCore.CAP
namespace
DotNetCore.CAP
...
...
src/DotNetCore.CAP/IConsumerHandler.Default.cs
View file @
819c4465
using
System
;
using
System
;
using
System.Linq
;
using
System.Threading
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
DotNetCore.CAP.Infrastructure
;
using
DotNetCore.CAP.Infrastructure
;
...
...
src/DotNetCore.CAP/IQueueExecutor.cs
View file @
819c4465
using
System
;
using
System.Threading.Tasks
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
DotNetCore.CAP
namespace
DotNetCore.CAP
{
{
...
...
src/DotNetCore.CAP/IStorage.cs
View file @
819c4465
src/DotNetCore.CAP/IStorageTransaction.cs
View file @
819c4465
src/DotNetCore.CAP/Infrastructure/Helper.cs
View file @
819c4465
...
@@ -40,7 +40,7 @@ namespace DotNetCore.CAP.Infrastructure
...
@@ -40,7 +40,7 @@ namespace DotNetCore.CAP.Infrastructure
public
static
long
ToTimestamp
(
DateTime
value
)
public
static
long
ToTimestamp
(
DateTime
value
)
{
{
var
elapsedTime
=
value
-
Epoch
;
var
elapsedTime
=
value
-
Epoch
;
return
(
long
)
elapsedTime
.
TotalSeconds
;
return
(
long
)
elapsedTime
.
TotalSeconds
;
}
}
public
static
DateTime
FromTimestamp
(
long
value
)
public
static
DateTime
FromTimestamp
(
long
value
)
...
...
src/DotNetCore.CAP/Infrastructure/StatusName.cs
View file @
819c4465
using
System
;
namespace
DotNetCore.CAP.Infrastructure
using
System.Collections.Generic
;
using
System.Text
;
namespace
DotNetCore.CAP.Infrastructure
{
{
/// <summary>
/// <summary>
/// The message status name.
/// The message status name.
...
...
src/DotNetCore.CAP/Infrastructure/WaitHandleEx.cs
View file @
819c4465
...
@@ -21,7 +21,7 @@ namespace DotNetCore.CAP.Infrastructure
...
@@ -21,7 +21,7 @@ namespace DotNetCore.CAP.Infrastructure
var
tcs
=
new
TaskCompletionSource
<
bool
>();
var
tcs
=
new
TaskCompletionSource
<
bool
>();
registeredHandle
=
ThreadPool
.
RegisterWaitForSingleObject
(
registeredHandle
=
ThreadPool
.
RegisterWaitForSingleObject
(
handle
,
handle
,
(
state
,
timedOut
)
=>
((
TaskCompletionSource
<
bool
>)
state
).
TrySetResult
(!
timedOut
),
(
state
,
timedOut
)
=>
((
TaskCompletionSource
<
bool
>)
state
).
TrySetResult
(!
timedOut
),
tcs
,
tcs
,
timeout
,
timeout
,
true
);
true
);
...
...
src/DotNetCore.CAP/Internal/IConsumerServiceSelector.Default.cs
View file @
819c4465
...
@@ -44,7 +44,6 @@ namespace DotNetCore.CAP.Internal
...
@@ -44,7 +44,6 @@ namespace DotNetCore.CAP.Internal
return
executorDescriptorList
;
return
executorDescriptorList
;
}
}
private
static
IEnumerable
<
ConsumerExecutorDescriptor
>
FindConsumersFromInterfaceTypes
(
private
static
IEnumerable
<
ConsumerExecutorDescriptor
>
FindConsumersFromInterfaceTypes
(
IServiceProvider
provider
)
IServiceProvider
provider
)
{
{
...
...
src/DotNetCore.CAP/Internal/MethodMatcherCache.cs
View file @
819c4465
using
System
;
using
System
;
using
System.Linq
;
using
System.Collections.Concurrent
;
using
System.Collections.Concurrent
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
DotNetCore.CAP.Abstractions
;
using
DotNetCore.CAP.Abstractions
;
namespace
DotNetCore.CAP.Internal
namespace
DotNetCore.CAP.Internal
...
...
src/DotNetCore.CAP/Internal/ObjectMethodExecutor.cs
View file @
819c4465
...
@@ -130,7 +130,7 @@ namespace DotNetCore.CAP.Internal
...
@@ -130,7 +130,7 @@ namespace DotNetCore.CAP.Internal
private
static
ConsumerMethodExecutor
WrapVoidAction
(
VoidActionExecutor
executor
)
private
static
ConsumerMethodExecutor
WrapVoidAction
(
VoidActionExecutor
executor
)
{
{
return
delegate
(
object
target
,
object
[]
parameters
)
return
delegate
(
object
target
,
object
[]
parameters
)
{
{
executor
(
target
,
parameters
);
executor
(
target
,
parameters
);
return
null
;
return
null
;
...
@@ -192,7 +192,7 @@ namespace DotNetCore.CAP.Internal
...
@@ -192,7 +192,7 @@ namespace DotNetCore.CAP.Internal
/// </summary>
/// </summary>
private
static
async
Task
<
object
>
CastToObject
<
T
>(
Task
<
T
>
task
)
private
static
async
Task
<
object
>
CastToObject
<
T
>(
Task
<
T
>
task
)
{
{
return
(
object
)
await
task
;
return
(
object
)
await
task
;
}
}
private
static
Type
GetTaskInnerTypeOrNull
(
Type
type
)
private
static
Type
GetTaskInnerTypeOrNull
(
Type
type
)
...
@@ -279,7 +279,7 @@ namespace DotNetCore.CAP.Internal
...
@@ -279,7 +279,7 @@ namespace DotNetCore.CAP.Internal
private
static
Task
<
object
>
Convert
<
T
>(
object
taskAsObject
)
private
static
Task
<
object
>
Convert
<
T
>(
object
taskAsObject
)
{
{
var
task
=
(
Task
<
T
>)
taskAsObject
;
var
task
=
(
Task
<
T
>)
taskAsObject
;
return
CastToObject
<
T
>(
task
);
return
CastToObject
<
T
>(
task
);
}
}
...
...
src/DotNetCore.CAP/Internal/SubscriberNotFoundException.cs
View file @
819c4465
using
System
;
using
System
;
namespace
DotNetCore.CAP.Internal
namespace
DotNetCore.CAP.Internal
{
{
public
class
SubscriberNotFoundException
:
Exception
public
class
SubscriberNotFoundException
:
Exception
{
{
public
SubscriberNotFoundException
()
{
}
public
SubscriberNotFoundException
()
{
}
public
SubscriberNotFoundException
(
string
message
)
:
base
(
message
)
{
}
public
SubscriberNotFoundException
(
string
message
)
:
base
(
message
)
{
}
public
SubscriberNotFoundException
(
string
message
,
Exception
inner
)
:
public
SubscriberNotFoundException
(
string
message
,
Exception
inner
)
:
base
(
message
,
inner
)
{
}
base
(
message
,
inner
)
{
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/LoggerExtensions.cs
View file @
819c4465
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
DotNetCore.CAP.Processor
;
using
Microsoft.Extensions.Logging
;
using
Microsoft.Extensions.Logging
;
namespace
DotNetCore.CAP
namespace
DotNetCore.CAP
...
@@ -66,7 +63,6 @@ namespace DotNetCore.CAP
...
@@ -66,7 +63,6 @@ namespace DotNetCore.CAP
5
,
5
,
"Received message topic method '{topicName}' failed to execute."
);
"Received message topic method '{topicName}' failed to execute."
);
_jobRetrying
=
LoggerMessage
.
Define
<
int
>(
_jobRetrying
=
LoggerMessage
.
Define
<
int
>(
LogLevel
.
Debug
,
LogLevel
.
Debug
,
3
,
3
,
...
@@ -104,19 +100,16 @@ namespace DotNetCore.CAP
...
@@ -104,19 +100,16 @@ namespace DotNetCore.CAP
_jobFailedWillRetry
(
logger
,
ex
);
_jobFailedWillRetry
(
logger
,
ex
);
}
}
public
static
void
JobRetrying
(
this
ILogger
logger
,
int
retries
)
public
static
void
JobRetrying
(
this
ILogger
logger
,
int
retries
)
{
{
_jobRetrying
(
logger
,
retries
,
null
);
_jobRetrying
(
logger
,
retries
,
null
);
}
}
public
static
void
JobExecuted
(
this
ILogger
logger
,
double
seconds
)
public
static
void
JobExecuted
(
this
ILogger
logger
,
double
seconds
)
{
{
_jobExecuted
(
logger
,
seconds
,
null
);
_jobExecuted
(
logger
,
seconds
,
null
);
}
}
public
static
void
ConsumerMethodExecutingFailed
(
this
ILogger
logger
,
string
methodName
,
Exception
ex
)
public
static
void
ConsumerMethodExecutingFailed
(
this
ILogger
logger
,
string
methodName
,
Exception
ex
)
{
{
_executingConsumerMethod
(
logger
,
methodName
,
ex
);
_executingConsumerMethod
(
logger
,
methodName
,
ex
);
...
...
src/DotNetCore.CAP/Models/CapPublishedMessage.cs
View file @
819c4465
src/DotNetCore.CAP/Models/CapQueue.cs
View file @
819c4465
src/DotNetCore.CAP/Models/MessageType.cs
View file @
819c4465
src/DotNetCore.CAP/OperateResult.cs
View file @
819c4465
...
@@ -32,7 +32,7 @@ namespace DotNetCore.CAP
...
@@ -32,7 +32,7 @@ namespace DotNetCore.CAP
/// Returns an <see cref="OperateResult"/> indicating a successful identity operation.
/// Returns an <see cref="OperateResult"/> indicating a successful identity operation.
/// </summary>
/// </summary>
/// <returns>An <see cref="OperateResult"/> indicating a successful operation.</returns>
/// <returns>An <see cref="OperateResult"/> indicating a successful operation.</returns>
public
static
OperateResult
Success
{
get
;
}
=
new
OperateResult
{
Succeeded
=
true
};
public
static
OperateResult
Success
{
get
;
}
=
new
OperateResult
{
Succeeded
=
true
};
/// <summary>
/// <summary>
/// Creates an <see cref="OperateResult"/> indicating a failed operation, with a list of <paramref name="errors"/> if applicable.
/// Creates an <see cref="OperateResult"/> indicating a failed operation, with a list of <paramref name="errors"/> if applicable.
...
@@ -41,7 +41,7 @@ namespace DotNetCore.CAP
...
@@ -41,7 +41,7 @@ namespace DotNetCore.CAP
/// <returns>An <see cref="OperateResult"/> indicating a failed operation, with a list of <paramref name="errors"/> if applicable.</returns>
/// <returns>An <see cref="OperateResult"/> indicating a failed operation, with a list of <paramref name="errors"/> if applicable.</returns>
public
static
OperateResult
Failed
(
params
OperateError
[]
errors
)
public
static
OperateResult
Failed
(
params
OperateError
[]
errors
)
{
{
var
result
=
new
OperateResult
{
Succeeded
=
false
};
var
result
=
new
OperateResult
{
Succeeded
=
false
};
if
(
errors
!=
null
)
if
(
errors
!=
null
)
{
{
result
.
_errors
.
AddRange
(
errors
);
result
.
_errors
.
AddRange
(
errors
);
...
...
src/DotNetCore.CAP/Processor/IAdditionalProcessor.cs
View file @
819c4465
using
System
;
namespace
DotNetCore.CAP.Processor
using
System.Collections.Generic
;
using
System.Text
;
namespace
DotNetCore.CAP.Processor
{
{
public
interface
IAdditionalProcessor
:
IProcessor
public
interface
IAdditionalProcessor
:
IProcessor
{
{
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Processor/IDispatcher.Default.cs
View file @
819c4465
src/DotNetCore.CAP/Processor/IDispatcher.cs
View file @
819c4465
using
System
;
namespace
DotNetCore.CAP.Processor
using
System.Collections.Generic
;
using
System.Text
;
namespace
DotNetCore.CAP.Processor
{
{
public
interface
IDispatcher
:
IProcessor
public
interface
IDispatcher
:
IProcessor
{
{
...
...
src/DotNetCore.CAP/Processor/IProcessor.PublishQueuer.cs
View file @
819c4465
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
using
System.Threading
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
DotNetCore.CAP.Infrastructure
;
using
DotNetCore.CAP.Infrastructure
;
using
DotNetCore.CAP.Processor.States
;
using
DotNetCore.CAP.Models
;
using
DotNetCore.CAP.Models
;
using
DotNetCore.CAP.Processor.States
;
using
Microsoft.Extensions.DependencyInjection
;
using
Microsoft.Extensions.DependencyInjection
;
using
Microsoft.Extensions.Logging
;
using
Microsoft.Extensions.Logging
;
using
Microsoft.Extensions.Options
;
using
Microsoft.Extensions.Options
;
...
...
src/DotNetCore.CAP/Processor/IProcessor.SubscribeQueuer.cs
View file @
819c4465
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
using
System.Threading
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
DotNetCore.CAP.Infrastructure
;
using
DotNetCore.CAP.Infrastructure
;
using
DotNetCore.CAP.Processor.States
;
using
DotNetCore.CAP.Models
;
using
DotNetCore.CAP.Models
;
using
DotNetCore.CAP.Processor.States
;
using
Microsoft.Extensions.DependencyInjection
;
using
Microsoft.Extensions.DependencyInjection
;
using
Microsoft.Extensions.Logging
;
using
Microsoft.Extensions.Logging
;
using
Microsoft.Extensions.Options
;
using
Microsoft.Extensions.Options
;
...
...
src/DotNetCore.CAP/Processor/RetryBehavior.cs
View file @
819c4465
...
@@ -18,7 +18,7 @@ namespace DotNetCore.CAP.Processor
...
@@ -18,7 +18,7 @@ namespace DotNetCore.CAP.Processor
{
{
DefaultRetryCount
=
25
;
DefaultRetryCount
=
25
;
DefaultRetryInThunk
=
retries
=>
DefaultRetryInThunk
=
retries
=>
(
int
)
Math
.
Round
(
Math
.
Pow
(
retries
-
1
,
4
)
+
15
+
(
_random
.
Next
(
30
)
*
(
retries
)));
(
int
)
Math
.
Round
(
Math
.
Pow
(
retries
-
1
,
4
)
+
15
+
(
_random
.
Next
(
30
)
*
(
retries
)));
DefaultRetry
=
new
RetryBehavior
(
true
);
DefaultRetry
=
new
RetryBehavior
(
true
);
NoRetry
=
new
RetryBehavior
(
false
);
NoRetry
=
new
RetryBehavior
(
false
);
...
...
src/DotNetCore.CAP/QueueExecutorFactory.cs
View file @
819c4465
...
@@ -19,7 +19,7 @@ namespace DotNetCore.CAP
...
@@ -19,7 +19,7 @@ namespace DotNetCore.CAP
{
{
var
_queueExectors
=
_serviceProvider
.
GetServices
<
IQueueExecutor
>();
var
_queueExectors
=
_serviceProvider
.
GetServices
<
IQueueExecutor
>();
if
(
messageType
==
MessageType
.
Publish
)
if
(
messageType
==
MessageType
.
Publish
)
{
{
return
_queueExectors
.
FirstOrDefault
(
x
=>
typeof
(
BasePublishQueueExecutor
).
IsAssignableFrom
(
x
.
GetType
()));
return
_queueExectors
.
FirstOrDefault
(
x
=>
typeof
(
BasePublishQueueExecutor
).
IsAssignableFrom
(
x
.
GetType
()));
}
}
...
...
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