Skip to content

Commit fa49c8e

Browse files
Disabled pipeline resolving
1 parent 18ae667 commit fa49c8e

9 files changed

Lines changed: 10 additions & 11 deletions

File tree

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<ImplicitUsings>enable</ImplicitUsings>
55
<Nullable>enable</Nullable>
66
<IsPackable>true</IsPackable>
7-
<Version>2.3.19</Version>
7+
<Version>2.3.24</Version>
88
<Authors>Andrey Serdyuk</Authors>
99
<Company>TaskHub</Company>
1010
<Title>TaskHub.Shared - Reusable Primitives for .NET Microservices</Title>

TaskHub.Observability.OpenTelemetry/Bootstrap/OpenTelemetryBootstrap.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public static void AddAppOpenTelemetry(this IServiceCollection services, Action<
2222
t.AddAttributes([new("deployment.environment", options.Environment)]);
2323
}).WithTracing(t =>
2424
{
25-
t.AddSource("CommandsBus", "NominatimClient", "NominatimService");
25+
t.AddSource("CommandsBus", "NominatimClient", "NominatimService", "Networking");
2626
t.AddSource([.. options.Sources]);
2727

2828
if (options.Sampling.IsEnabled)

TaskHub.Shared.Commands.Implementation/Bootstrap/BusBootstrap.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public static class BusBootstrap
88
{
99
public static void AddAppCommandsBus(this IServiceCollection services, Type[] types)
1010
{
11-
services.AddAppPipeline(types);
11+
//services.AddAppPipeline(types);
1212
services.AddScoped<ICommandsBus>(sp => new CommandsBus(
1313
sp.GetRequiredService<IServiceScopeFactory>(),
1414
sp.GetRequiredService<IHistogramMetricFactory>().Get("CommandBus")

TaskHub.Shared.Commands.Implementation/Bootstrap/PipelineBootstrap.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
namespace TaskHub.Shared.Commands.Implementation.Bootstrap;
88

9+
/// <summary>
10+
/// Candidate for deprecation
11+
/// </summary>
912
public static class PipelineBootstrap
1013
{
1114
public static void AddAppPipeline(this IServiceCollection services, IEnumerable<Type> types)
@@ -15,20 +18,19 @@ public static void AddAppPipeline(this IServiceCollection services, IEnumerable<
1518
var closedTypes = src.Where(t => !t.IsGenericTypeDefinition).ToArray();
1619

1720
var openPre = openTypes
18-
.Where(i => i.GetCustomAttribute<SharedBehaviorAttribute>() != null)
1921
.Where(i => i.GetInterfaces().Any(j => j.IsGenericType && j.GetGenericTypeDefinition() == typeof(IPreBehavior<,>)))
2022
.Select(i => new
2123
{
2224
Type = i,
2325
Order = i.GetCustomAttribute<OrderAttribute>()?.Order ?? int.MinValue
2426
}).OrderBy(i => i.Order).Select(i => i.Type).ToArray();
27+
2528
foreach (var type in openPre)
2629
{
2730
services.AddScoped(typeof(IPreBehavior<,>), type);
2831
}
2932

3033
var openPost = openTypes
31-
.Where(i => i.GetCustomAttribute<SharedBehaviorAttribute>() != null)
3234
.Where(i => i.GetInterfaces().Any(j => j.IsGenericType && j.GetGenericTypeDefinition() == typeof(IPostBehavior<,>)))
3335
.Select(i => new
3436
{

TaskHub.Shared.Commands.Implementation/CommandsBus.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ private async Task<TResult> InvokeScoped<TCommand, TResult>(
4242
return await invoker(scope.ServiceProvider, command, ct).ConfigureAwait(false);
4343
}
4444

45-
private Func<IServiceProvider, TCommand, CancellationToken, Task<TResult>> BuildInvoker<TCommand, TResult>()
45+
private static Func<IServiceProvider, TCommand, CancellationToken, Task<TResult>> BuildInvoker<TCommand, TResult>()
4646
where TCommand : ICommand
4747
where TResult : Result
4848
{

TaskHub.Shared.Networking.Abstractions/ClientBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ namespace TaskHub.Shared.Networking.Abstractions;
44

55
public abstract class ClientBase
66
{
7-
protected static readonly ActivitySource ActivitySource = new("JobClient");
7+
protected static readonly ActivitySource ActivitySource = new("Networking");
88
}

TaskHub.Shared.Networking.Implementation/Bootstrap/AppHttpClient.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public static void AddAppNetworkingSettings(this IServiceCollection services, Ac
1616
{
1717
var settings = new NetworkOptions();
1818
action(settings);
19+
services.AddTransient<BearerTokenHandler>();
1920
foreach (var (name, node) in settings.Services)
2021
{
2122
services.AddAppHttpClient(name, settings.Defaults, new OptionsResolver(settings.Defaults, node).Resolve());

TaskHub.Shared.Response/Result.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Diagnostics;
2-
using System.Text.Json.Serialization;
32

43
namespace TaskHub.Shared.Response;
54

@@ -10,7 +9,6 @@ public class Result
109
public string Message { get; init; }
1110
public static implicit operator Result(OpResult op) => new(op.ResultCode, op.Message);
1211

13-
[JsonConstructor]
1412
public Result(int code, string message)
1513
{
1614
ResultCode = code;

TaskHub.Shared.Response/ValueResult.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Diagnostics;
2-
using System.Text.Json.Serialization;
32

43
namespace TaskHub.Shared.Response;
54

@@ -8,7 +7,6 @@ public sealed class ValueResult<T> : Result
87
public T? Data { get; init; }
98
public static implicit operator ValueResult<T>(OpResult op) => new(op.ResultCode, op.Message, default);
109

11-
[JsonConstructor]
1210
public ValueResult(int code, string message, T? data) : base(code, message)
1311
{
1412
Data = data;

0 commit comments

Comments
 (0)