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
e5175a6c
Commit
e5175a6c
authored
Oct 25, 2019
by
Savorboard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code cleanup
parent
b1bd53bf
Changes
18
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
19 additions
and
224 deletions
+19
-224
MySqlDataStorage.cs
src/DotNetCore.CAP.MySql/MySqlDataStorage.cs
+1
-1
CapPublisher.cs
src/DotNetCore.CAP/Abstractions/CapPublisher.cs
+1
-1
CAP.Attribute.cs
src/DotNetCore.CAP/CAP.Attribute.cs
+10
-3
Cap.Header.cs
src/DotNetCore.CAP/Cap.Header.cs
+0
-13
ICallbackPublisher.cs
src/DotNetCore.CAP/ICallbackPublisher.cs
+0
-19
IConsumerServiceSelector.Default.cs
src/DotNetCore.CAP/IConsumerServiceSelector.Default.cs
+1
-1
IStorageConnection.cs
src/DotNetCore.CAP/IStorageConnection.cs
+0
-62
ISubscribeExecutor.Default.cs
src/DotNetCore.CAP/ISubscribeExecutor.Default.cs
+0
-1
Helper.cs
src/DotNetCore.CAP/Internal/Helper.cs
+1
-1
IMessageSender.Default.cs
src/DotNetCore.CAP/Internal/IMessageSender.Default.cs
+0
-1
ObjectId.cs
src/DotNetCore.CAP/Internal/ObjectId.cs
+1
-1
SnowflakeId.cs
src/DotNetCore.CAP/Internal/SnowflakeId.cs
+1
-1
StatusName.cs
src/DotNetCore.CAP/Internal/StatusName.cs
+1
-1
WaitHandleEx.cs
src/DotNetCore.CAP/Internal/WaitHandleEx.cs
+1
-1
CapPublishedMessage.cs
src/DotNetCore.CAP/Persistence/CapPublishedMessage.cs
+0
-25
CapReceivedMessage.cs
src/DotNetCore.CAP/Persistence/CapReceivedMessage.cs
+0
-39
IDashboardQuerying.cs
src/DotNetCore.CAP/Persistence/IDashboardQuerying.cs
+0
-26
IDataStorage.cs
src/DotNetCore.CAP/Persistence/IDataStorage.cs
+1
-27
No files found.
src/DotNetCore.CAP.MySql/MySqlDataStorage.cs
View file @
e5175a6c
...
@@ -4,7 +4,7 @@ using System.Data;
...
@@ -4,7 +4,7 @@ using System.Data;
using
System.Threading
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
Dapper
;
using
Dapper
;
using
DotNetCore.CAP.In
frastructure
;
using
DotNetCore.CAP.In
ternal
;
using
DotNetCore.CAP.Messages
;
using
DotNetCore.CAP.Messages
;
using
DotNetCore.CAP.Persistence
;
using
DotNetCore.CAP.Persistence
;
using
DotNetCore.CAP.Serialization
;
using
DotNetCore.CAP.Serialization
;
...
...
src/DotNetCore.CAP/Abstractions/CapPublisher.cs
View file @
e5175a6c
...
@@ -7,7 +7,7 @@ using System.Diagnostics;
...
@@ -7,7 +7,7 @@ using System.Diagnostics;
using
System.Threading
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
DotNetCore.CAP.Diagnostics
;
using
DotNetCore.CAP.Diagnostics
;
using
DotNetCore.CAP.In
frastructure
;
using
DotNetCore.CAP.In
ternal
;
using
DotNetCore.CAP.Messages
;
using
DotNetCore.CAP.Messages
;
using
DotNetCore.CAP.Persistence
;
using
DotNetCore.CAP.Persistence
;
using
Microsoft.Extensions.DependencyInjection
;
using
Microsoft.Extensions.DependencyInjection
;
...
...
src/DotNetCore.CAP/CAP.
Subscribe
Attribute.cs
→
src/DotNetCore.CAP/CAP.Attribute.cs
View file @
e5175a6c
...
@@ -2,14 +2,13 @@
...
@@ -2,14 +2,13 @@
// Licensed under the MIT License. See License.txt in the project root for license information.
// Licensed under the MIT License. See License.txt in the project root for license information.
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.ObjectModel
;
using
DotNetCore.CAP.Abstractions
;
using
DotNetCore.CAP.Abstractions
;
// ReSharper disable once CheckNamespace
// ReSharper disable once CheckNamespace
namespace
DotNetCore.CAP
namespace
DotNetCore.CAP
{
{
/// <summary>
/// An attribute for subscribe event bus message.
/// </summary>
public
class
CapSubscribeAttribute
:
TopicAttribute
public
class
CapSubscribeAttribute
:
TopicAttribute
{
{
public
CapSubscribeAttribute
(
string
name
)
public
CapSubscribeAttribute
(
string
name
)
...
@@ -29,4 +28,12 @@ namespace DotNetCore.CAP
...
@@ -29,4 +28,12 @@ namespace DotNetCore.CAP
{
{
}
}
public
class
CapHeader
:
ReadOnlyDictionary
<
string
,
string
>
{
public
CapHeader
(
IDictionary
<
string
,
string
>
dictionary
)
:
base
(
dictionary
)
{
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Cap.Header.cs
deleted
100644 → 0
View file @
b1bd53bf
using
System.Collections.Generic
;
using
System.Collections.ObjectModel
;
namespace
DotNetCore.CAP
{
public
class
CapHeader
:
ReadOnlyDictionary
<
string
,
string
>
{
public
CapHeader
(
IDictionary
<
string
,
string
>
dictionary
)
:
base
(
dictionary
)
{
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/ICallbackPublisher.cs
deleted
100644 → 0
View file @
b1bd53bf
// Copyright (c) .NET Core Community. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using
System.Threading.Tasks
;
using
DotNetCore.CAP.Messages
;
namespace
DotNetCore.CAP
{
/// <summary>
/// A callback that is sent to Producer after a successful consumer execution
/// </summary>
public
interface
ICallbackPublisher
{
/// <summary>
/// Publish a callback message
/// </summary>
Task
PublishCallbackAsync
(
CapPublishedMessage
obj
);
}
}
\ No newline at end of file
src/DotNetCore.CAP/IConsumerServiceSelector.Default.cs
View file @
e5175a6c
...
@@ -7,9 +7,9 @@ using System.Linq;
...
@@ -7,9 +7,9 @@ using System.Linq;
using
System.Reflection
;
using
System.Reflection
;
using
System.Text.RegularExpressions
;
using
System.Text.RegularExpressions
;
using
DotNetCore.CAP.Abstractions
;
using
DotNetCore.CAP.Abstractions
;
using
DotNetCore.CAP.Infrastructure
;
using
Microsoft.Extensions.DependencyInjection
;
using
Microsoft.Extensions.DependencyInjection
;
using
System.Collections.Concurrent
;
using
System.Collections.Concurrent
;
using
DotNetCore.CAP.Internal
;
using
Microsoft.Extensions.Options
;
using
Microsoft.Extensions.Options
;
namespace
DotNetCore.CAP
namespace
DotNetCore.CAP
...
...
src/DotNetCore.CAP/IStorageConnection.cs
deleted
100644 → 0
View file @
b1bd53bf
// Copyright (c) .NET Core Community. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using
System.Collections.Generic
;
using
System.Threading.Tasks
;
using
DotNetCore.CAP.Messages
;
namespace
DotNetCore.CAP
{
/// <summary>
/// Represents a connection to the storage.
/// </summary>
public
interface
IStorageConnection
{
//Sent messages
/// <summary>
/// Returns the message with the given id.
/// </summary>
/// <param name="id">The message's id.</param>
Task
<
CapPublishedMessage
>
GetPublishedMessageAsync
(
long
id
);
/// <summary>
/// Returns executed failed messages.
/// </summary>
Task
<
IEnumerable
<
CapPublishedMessage
>>
GetPublishedMessagesOfNeedRetry
();
// Received messages
/// <summary>
/// Stores the message.
/// </summary>
/// <param name="message">The message to store.</param>
void
StoreReceivedMessage
(
CapReceivedMessage
message
);
/// <summary>
/// Returns the message with the given id.
/// </summary>
/// <param name="id">The message's id.</param>
Task
<
CapReceivedMessage
>
GetReceivedMessageAsync
(
long
id
);
/// <summary>
/// Returns executed failed message.
/// </summary>
Task
<
IEnumerable
<
CapReceivedMessage
>>
GetReceivedMessagesOfNeedRetry
();
/// <summary>
/// Change specified message's state of published message
/// </summary>
/// <param name="messageId">Message id</param>
/// <param name="state">State name</param>
bool
ChangePublishedState
(
long
messageId
,
string
state
);
/// <summary>
/// Change specified message's state of received message
/// </summary>
/// <param name="messageId">Message id</param>
/// <param name="state">State name</param>
bool
ChangeReceivedState
(
long
messageId
,
string
state
);
}
}
\ No newline at end of file
src/DotNetCore.CAP/ISubscribeExecutor.Default.cs
View file @
e5175a6c
...
@@ -7,7 +7,6 @@ using System.Diagnostics;
...
@@ -7,7 +7,6 @@ using System.Diagnostics;
using
System.Threading
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
DotNetCore.CAP.Diagnostics
;
using
DotNetCore.CAP.Diagnostics
;
using
DotNetCore.CAP.Infrastructure
;
using
DotNetCore.CAP.Internal
;
using
DotNetCore.CAP.Internal
;
using
DotNetCore.CAP.Messages
;
using
DotNetCore.CAP.Messages
;
using
DotNetCore.CAP.Persistence
;
using
DotNetCore.CAP.Persistence
;
...
...
src/DotNetCore.CAP/In
frastructure
/Helper.cs
→
src/DotNetCore.CAP/In
ternal
/Helper.cs
View file @
e5175a6c
...
@@ -5,7 +5,7 @@ using System;
...
@@ -5,7 +5,7 @@ using System;
using
System.ComponentModel
;
using
System.ComponentModel
;
using
System.Reflection
;
using
System.Reflection
;
namespace
DotNetCore.CAP.In
frastructure
namespace
DotNetCore.CAP.In
ternal
{
{
public
static
class
Helper
public
static
class
Helper
{
{
...
...
src/DotNetCore.CAP/Internal/IMessageSender.Default.cs
View file @
e5175a6c
...
@@ -5,7 +5,6 @@ using System;
...
@@ -5,7 +5,6 @@ using System;
using
System.Diagnostics
;
using
System.Diagnostics
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
DotNetCore.CAP.Diagnostics
;
using
DotNetCore.CAP.Diagnostics
;
using
DotNetCore.CAP.Infrastructure
;
using
DotNetCore.CAP.Messages
;
using
DotNetCore.CAP.Messages
;
using
DotNetCore.CAP.Persistence
;
using
DotNetCore.CAP.Persistence
;
using
DotNetCore.CAP.Processor
;
using
DotNetCore.CAP.Processor
;
...
...
src/DotNetCore.CAP/In
frastructure
/ObjectId.cs
→
src/DotNetCore.CAP/In
ternal
/ObjectId.cs
View file @
e5175a6c
...
@@ -9,7 +9,7 @@ using System.Security.Cryptography;
...
@@ -9,7 +9,7 @@ using System.Security.Cryptography;
using
System.Text
;
using
System.Text
;
using
System.Threading
;
using
System.Threading
;
namespace
DotNetCore.CAP.In
frastructure
namespace
DotNetCore.CAP.In
ternal
{
{
/// <summary>
/// <summary>
/// Represents an ObjectId
/// Represents an ObjectId
...
...
src/DotNetCore.CAP/In
frastructure
/SnowflakeId.cs
→
src/DotNetCore.CAP/In
ternal
/SnowflakeId.cs
View file @
e5175a6c
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
using
System
;
using
System
;
namespace
DotNetCore.CAP.In
frastructure
namespace
DotNetCore.CAP.In
ternal
{
{
public
class
SnowflakeId
public
class
SnowflakeId
{
{
...
...
src/DotNetCore.CAP/In
frastructure
/StatusName.cs
→
src/DotNetCore.CAP/In
ternal
/StatusName.cs
View file @
e5175a6c
// Copyright (c) .NET Core Community. All rights reserved.
// Copyright (c) .NET Core Community. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Licensed under the MIT License. See License.txt in the project root for license information.
namespace
DotNetCore.CAP.In
frastructure
namespace
DotNetCore.CAP.In
ternal
{
{
/// <summary>
/// <summary>
/// The message status name.
/// The message status name.
...
...
src/DotNetCore.CAP/In
frastructure
/WaitHandleEx.cs
→
src/DotNetCore.CAP/In
ternal
/WaitHandleEx.cs
View file @
e5175a6c
...
@@ -5,7 +5,7 @@ using System;
...
@@ -5,7 +5,7 @@ using System;
using
System.Threading
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
namespace
DotNetCore.CAP.In
frastructure
namespace
DotNetCore.CAP.In
ternal
{
{
public
static
class
WaitHandleEx
public
static
class
WaitHandleEx
{
{
...
...
src/DotNetCore.CAP/Persistence/CapPublishedMessage.cs
deleted
100644 → 0
View file @
b1bd53bf
// Copyright (c) .NET Core Community. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using
System
;
namespace
DotNetCore.CAP.Messages
{
public
class
CapPublishedMessage
{
public
CapPublishedMessage
()
{
Added
=
DateTime
.
Now
;
}
public
Message
Message
{
get
;
set
;
}
public
DateTime
Added
{
get
;
set
;
}
public
DateTime
?
ExpiresAt
{
get
;
set
;
}
public
int
Retries
{
get
;
set
;
}
public
string
StatusName
{
get
;
set
;
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Persistence/CapReceivedMessage.cs
deleted
100644 → 0
View file @
b1bd53bf
// Copyright (c) .NET Core Community. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using
System
;
namespace
DotNetCore.CAP.Messages
{
public
class
CapReceivedMessage
{
/// <summary>
/// Initializes a new instance of <see cref="CapReceivedMessage" />.
/// </summary>
public
CapReceivedMessage
()
{
Added
=
DateTime
.
Now
;
}
public
long
Id
{
get
;
set
;
}
public
string
Group
{
get
;
set
;
}
public
string
Name
{
get
;
set
;
}
public
string
Content
{
get
;
set
;
}
public
DateTime
Added
{
get
;
set
;
}
public
DateTime
?
ExpiresAt
{
get
;
set
;
}
public
int
Retries
{
get
;
set
;
}
public
string
StatusName
{
get
;
set
;
}
public
override
string
ToString
()
{
return
"name:"
+
Name
+
", group:"
+
Group
+
", content:"
+
Content
;
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Persistence/IDashboardQuerying.cs
deleted
100644 → 0
View file @
b1bd53bf
//using System;
//using System.Collections.Generic;
//using DotNetCore.CAP.Dashboard.Monitoring;
//using DotNetCore.CAP.Messages;
//namespace DotNetCore.CAP.Persistence
//{
// public interface IDashboardQuerying
// {
// StatisticsDto GetStatistics();
// IList<MessageDto> Messages(MessageQueryDto queryDto);
// int PublishedFailedCount();
// int PublishedSucceededCount();
// int ReceivedFailedCount();
// int ReceivedSucceededCount();
// IDictionary<DateTime, int> HourlySucceededJobs(MessageType type);
// IDictionary<DateTime, int> HourlyFailedJobs(MessageType type);
// }
//}
src/DotNetCore.CAP/Persistence/IDataStorage.cs
View file @
e5175a6c
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Threading
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
DotNetCore.CAP.In
frastructure
;
using
DotNetCore.CAP.In
ternal
;
using
DotNetCore.CAP.Messages
;
using
DotNetCore.CAP.Messages
;
namespace
DotNetCore.CAP.Persistence
namespace
DotNetCore.CAP.Persistence
...
@@ -22,31 +22,5 @@ namespace DotNetCore.CAP.Persistence
...
@@ -22,31 +22,5 @@ namespace DotNetCore.CAP.Persistence
Task
<
IEnumerable
<
MediumMessage
>>
GetPublishedMessagesOfNeedRetry
();
Task
<
IEnumerable
<
MediumMessage
>>
GetPublishedMessagesOfNeedRetry
();
Task
<
IEnumerable
<
MediumMessage
>>
GetReceivedMessagesOfNeedRetry
();
Task
<
IEnumerable
<
MediumMessage
>>
GetReceivedMessagesOfNeedRetry
();
//Task<CapPublishedMessage> GetPublishedMessageAsync(long id);
//Task<CapReceivedMessage> GetReceivedMessageAsync(long id);
//public void UpdateMessage(CapPublishedMessage message)
//{
// if (message == null)
// {
// throw new ArgumentNullException(nameof(message));
// }
// var sql =
// $"UPDATE `{_prefix}.published` SET `Retries` = @Retries,`Content`= @Content,`ExpiresAt` = @ExpiresAt,`StatusName`=@StatusName WHERE `Id`=@Id;";
// _dbConnection.Execute(sql, message);
//}
//public void UpdateMessage(CapReceivedMessage message)
//{
// if (message == null)
// {
// throw new ArgumentNullException(nameof(message));
// }
// var sql = $"UPDATE `{_prefix}.received` SET `Retries` = @Retries,`Content`= @Content,`ExpiresAt` = @ExpiresAt,`StatusName`=@StatusName WHERE `Id`=@Id;";
// _dbConnection.Execute(sql, message);
//}
}
}
}
}
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