-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enable dynamic worker calculation
- Loading branch information
1 parent
3561fe6
commit 9755155
Showing
31 changed files
with
2,292 additions
and
13,051 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
36 changes: 36 additions & 0 deletions
36
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,36 @@ | ||
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 | ||
{ | ||
public WorkersCountContext( | ||
IDependencyResolver dependencyResolver, | ||
string consumerName, | ||
string consumerGroupId, | ||
IReadOnlyCollection<TopicPartitions> assignedPartitions) | ||
{ | ||
this.DependencyResolver = dependencyResolver; | ||
this.ConsumerName = consumerName; | ||
this.ConsumerGroupId = consumerGroupId; | ||
this.AssignedPartitions = assignedPartitions; | ||
} | ||
|
||
/// <summary> | ||
/// Gets the dependency injection container abstraction | ||
/// </summary> | ||
public IDependencyResolver DependencyResolver { get; } | ||
|
||
public string ConsumerName { get; } | ||
|
||
public string ConsumerGroupId { get; } | ||
|
||
/// <summary> | ||
/// Gets the assigned partitions to the consumer | ||
/// </summary> | ||
public IReadOnlyCollection<TopicPartitions> AssignedPartitions { 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
Oops, something went wrong.