-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/release/3.0' into refactor!/me…
…rge-projects # Conflicts: # src/KafkaFlow.BatchConsume/KafkaFlow.BatchConsume.csproj # src/KafkaFlow.Compressor/ConfigurationBuilderExtensions.cs # src/KafkaFlow.TypedHandler/ConfigurationBuilderExtensions.cs # src/KafkaFlow.UnitTests/BatchConsume/BatchConsumeMiddlewareTests.cs # src/KafkaFlow/Extensions/ConfigurationBuilderExtensions.cs
- Loading branch information
Showing
97 changed files
with
4,002 additions
and
13,760 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/KafkaFlow.Abstractions/Configuration/WorkersCountContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
namespace KafkaFlow.Configuration | ||
{ | ||
using System.Collections.Generic; | ||
|
||
/// <summary> | ||
/// A metadata class with some context information help to calculate the number of workers | ||
/// </summary> | ||
public class WorkersCountContext | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="WorkersCountContext"/> class. | ||
/// </summary> | ||
/// <param name="consumerName">The consumer's name</param> | ||
/// <param name="consumerGroupId">The consumer's group id</param> | ||
/// <param name="assignedTopicsPartitions">The consumer's assigned partition</param> | ||
public WorkersCountContext( | ||
string consumerName, | ||
string consumerGroupId, | ||
IReadOnlyCollection<TopicPartitions> assignedTopicsPartitions) | ||
{ | ||
this.ConsumerName = consumerName; | ||
this.ConsumerGroupId = consumerGroupId; | ||
this.AssignedTopicsPartitions = assignedTopicsPartitions; | ||
} | ||
|
||
/// <summary> | ||
/// Gets the consumer's name | ||
/// </summary> | ||
public string ConsumerName { get; } | ||
|
||
/// <summary> | ||
/// Gets the consumer's group id | ||
/// </summary> | ||
public string ConsumerGroupId { get; } | ||
|
||
/// <summary> | ||
/// Gets the assigned partitions to the consumer | ||
/// </summary> | ||
public IReadOnlyCollection<TopicPartitions> AssignedTopicsPartitions { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
namespace KafkaFlow | ||
{ | ||
/// <summary> | ||
/// Represents the interface of a internal worker | ||
/// </summary> | ||
public interface IWorker | ||
{ | ||
/// <summary> | ||
/// Gets worker's id | ||
/// </summary> | ||
int Id { get; } | ||
|
||
/// <summary> | ||
/// Gets the subject for worker stopping events where observers can subscribe to receive notifications. | ||
/// </summary> | ||
IEvent WorkerStopping { get; } | ||
|
||
/// <summary> | ||
/// Gets the subject for worker stopped events where observers can subscribe to receive notifications. | ||
/// </summary> | ||
IEvent WorkerStopped { get; } | ||
|
||
/// <summary> | ||
/// Gets the subject for worker consumption completed events where observers can subscribe to receive notifications. | ||
/// </summary> | ||
IEvent<IMessageContext> WorkerProcessingEnded { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
namespace KafkaFlow | ||
{ | ||
using System; | ||
using System.Threading.Tasks; | ||
|
||
/// <summary> | ||
/// Represents an Event to be subscribed. | ||
/// </summary> | ||
public interface IEvent | ||
{ | ||
/// <summary> | ||
/// Subscribes to the event. | ||
/// </summary> | ||
/// <param name="handler">The handler to be called when the event is fired.</param> | ||
/// <returns>Event subscription reference</returns> | ||
IEventSubscription Subscribe(Func<Task> handler); | ||
} | ||
|
||
/// <summary> | ||
/// Represents an Event to be subscribed. | ||
/// </summary> | ||
/// <typeparam name="TArg">The argument expected by the event.</typeparam> | ||
public interface IEvent<TArg> | ||
{ | ||
/// <summary> | ||
/// Subscribes to the event. | ||
/// </summary> | ||
/// <param name="handler">The handler to be called when the event is fired.</param> | ||
/// <returns>Event subscription reference</returns> | ||
IEventSubscription Subscribe(Func<TArg, Task> handler); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace KafkaFlow; | ||
|
||
/// <summary> | ||
/// Represents an Event subscription. | ||
/// </summary> | ||
public interface IEventSubscription | ||
{ | ||
/// <summary> | ||
/// Cancels the subscription to the event. | ||
/// </summary> | ||
void Cancel(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,29 @@ | ||
namespace KafkaFlow | ||
namespace KafkaFlow; | ||
|
||
/// <summary> | ||
/// Some producer metadata | ||
/// </summary> | ||
public interface IProducerContext | ||
{ | ||
/// <summary> | ||
/// Some producer metadata | ||
/// Gets the topic associated with the message | ||
/// </summary> | ||
string Topic { get; } | ||
|
||
/// <summary> | ||
/// Gets the partition associated with the message | ||
/// </summary> | ||
public interface IProducerContext | ||
{ | ||
/// <summary> | ||
/// Gets the topic associated with the message | ||
/// </summary> | ||
string Topic { get; } | ||
int? Partition { get; } | ||
|
||
/// <summary> | ||
/// Gets the partition associated with the message | ||
/// </summary> | ||
int? Partition { get; } | ||
/// <summary> | ||
/// Gets the partition offset associated with the message | ||
/// </summary> | ||
long? Offset { get; } | ||
|
||
/// <summary> | ||
/// Gets the partition offset associated with the message | ||
/// </summary> | ||
long? Offset { get; } | ||
} | ||
/// <summary> | ||
/// Gets an instance of IDependencyResolver which provides methods to resolve dependencies. | ||
/// This instance is tied to the producer scope, meaning it is capable of resolving dependencies | ||
/// that are scoped to the lifecycle of a single producer. | ||
/// </summary> | ||
IDependencyResolver DependencyResolver { get; } | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.