Skip to content

Commit

Permalink
Some typos
Browse files Browse the repository at this point in the history
  • Loading branch information
cortex93 committed Sep 23, 2017
1 parent 7b9a122 commit 4cf8ba0
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 30 deletions.
4 changes: 2 additions & 2 deletions sample/RawRabbit.ConsoleApp.Sample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static async Task RunAsync()
.UseMessageContext<MessageContext>()
});

await _client.SubscribeAsync<ValuesRequested, MessageContext>((requested, ctx) => ServeValuesAsync(requested, ctx));
await _client.SubscribeAsync<ValuesRequested, MessageContext>((requested, ctx) => ServerValuesAsync(requested, ctx));
await _client.RespondAsync<ValueRequest, ValueResponse>(request => SendValuesThoughRpcAsync(request));
}

Expand All @@ -51,7 +51,7 @@ private static Task<ValueResponse> SendValuesThoughRpcAsync(ValueRequest request
});
}

private static Task ServeValuesAsync(ValuesRequested message, MessageContext ctx)
private static Task ServerValuesAsync(ValuesRequested message, MessageContext ctx)
{
var values = new List<string>();
for (var i = 0; i < message.NumberOfValues; i++)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static class RespondMessageContextExtension
BodyTypeFunc = context => context.GetRequestMessageType()
})
.Use<StageMarkerMiddleware>(StageMarkerOptions.For(RespondStage.MessageDeserialized))
.Use<HandlerInvokationMiddleware >(ResponseHandlerOptionFactory.Create(new HandlerInvokationOptions
.Use<HandlerInvocationMiddleware >(ResponseHandlerOptionFactory.Create(new HandlerInvocationOptions
{
HandlerArgsFunc = context => new[] { context.GetMessage(), context.GetMessageContext() }
}))
Expand Down Expand Up @@ -73,7 +73,7 @@ public static Task<IPipeContext> RespondAsync<TRequest, TResponse, TMessageConte
throw tResponse.Exception;
return tResponse.Result.AsUntyped();
}, ct));
ctx.Properties.Add(RespondKey.IncommingMessageType, typeof(TRequest));
ctx.Properties.Add(RespondKey.IncomingMessageType, typeof(TRequest));
ctx.Properties.Add(RespondKey.OutgoingMessageType, typeof(TResponse));
ctx.AddMessageContextType<TMessageContext>();
ctx.Properties.Add(PipeKey.MessageHandler, genericHandler);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static class SubscribeMessageContextExtension
.Use<BodyDeserializationMiddleware>()
.Use<StageMarkerMiddleware>(StageMarkerOptions.For(StageMarker.MessageDeserialized))
.Use<StageMarkerMiddleware>(StageMarkerOptions.For(MessageContextSubscibeStage.MessageContextDeserialized))
.Use<HandlerInvokationMiddleware>(new HandlerInvokationOptions
.Use<HandlerInvocationMiddleware>(new HandlerInvocationOptions
{
HandlerArgsFunc = context => new[]
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

namespace RawRabbit.Enrichers.Polly.Middleware
{
public class HandlerInvokationMiddleware : Pipe.Middleware.HandlerInvokationMiddleware
public class HandlerInvocationMiddleware : Pipe.Middleware.HandlerInvocationMiddleware
{
public HandlerInvokationMiddleware(HandlerInvokationOptions options = null)
public HandlerInvocationMiddleware(HandlerInvocationOptions options = null)
: base(options) { }

protected override Task InvokeMessageHandler(IPipeContext context, CancellationToken token)
{
var policy = context.GetPolicy(PolicyKeys.HandlerInvokation);
var policy = context.GetPolicy(PolicyKeys.HandlerInvocation);
return policy.ExecuteAsync(
action: ct => base.InvokeMessageHandler(context, ct),
cancellationToken: token,
Expand Down
2 changes: 1 addition & 1 deletion src/RawRabbit.Enrichers.Polly/PolicyKeys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ public class PolicyKeys
public const string QueueBind = "QueueBind";
public const string ExchangeDeclare = "ExchangeDeclare";
public const string BasicPublish = "BasicPublish";
public const string HandlerInvokation = "HandlerInvokation";
public const string HandlerInvocation = "HandlerInvocation";
}
}
2 changes: 1 addition & 1 deletion src/RawRabbit.Enrichers.Polly/PollyPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static IClientBuilder UsePolly(this IClientBuilder builder, PolicyOptions
.Replace<BasicPublishMiddleware, Enrichers.Polly.Middleware.BasicPublishMiddleware>(argsFunc: oldArgs => oldArgs)
.Replace<ExplicitAckMiddleware, Enrichers.Polly.Middleware.ExplicitAckMiddleware>(argsFunc: oldArgs => oldArgs)
.Replace<TransientChannelMiddleware, Enrichers.Polly.Middleware.TransientChannelMiddleware>(argsFunc: oldArgs => oldArgs)
.Replace<HandlerInvokationMiddleware, Enrichers.Polly.Middleware.HandlerInvokationMiddleware>(argsFunc: oldArgs => oldArgs)
.Replace<HandlerInvocationMiddleware, Enrichers.Polly.Middleware.HandlerInvocationMiddleware>(argsFunc: oldArgs => oldArgs)
);
return builder;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static class MessageAndContextTriggerExtension
.Use<ModelIdMiddleware>()
.Use<GlobalLockMiddleware>()
.Use<RetrieveStateMachineMiddleware>()
.Use<HandlerInvokationMiddleware>(new HandlerInvokationOptions
.Use<HandlerInvocationMiddleware>(new HandlerInvocationOptions
{
HandlerArgsFunc = context => context.GetLazyHandlerArgs()
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static object GetResponseMessage(this IPipeContext context)

public static Type GetRequestMessageType(this IPipeContext context)
{
return context.Get<Type>(RespondKey.IncommingMessageType);
return context.Get<Type>(RespondKey.IncomingMessageType);
}

public static Func<object, Task<object>> GetResponseMessageHandler(this IPipeContext context)
Expand Down
2 changes: 1 addition & 1 deletion src/RawRabbit.Operations.Respond/Core/RespondKey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public static class RespondKey
public const string OutgoingMessageType = "OutgoingMessageType";
public const string ResponseMessage = "ResponseMessage";
public const string SerializedResponse = "SerializedResponse";
public const string IncommingMessageType = "IncommingMessageType";
public const string IncomingMessageType = "IncommingMessageType";
public const string PublicationAddress = "PublicationAddress";
public const string Configuration = "Configuration";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ namespace RawRabbit.Operations.Respond.Middleware
{
public class ResponseHandlerOptionFactory
{
public static HandlerInvokationOptions Create(HandlerInvokationOptions options = null)
public static HandlerInvocationOptions Create(HandlerInvocationOptions options = null)
{
return new HandlerInvokationOptions
return new HandlerInvocationOptions
{
HandlerArgsFunc = options?.HandlerArgsFunc ?? (context => new[] {context.GetMessage()}),
PostInvokeAction = options?.PostInvokeAction ?? ((context, task) =>
Expand Down
4 changes: 2 additions & 2 deletions src/RawRabbit.Operations.Respond/RespondExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static class RespondExtension
BodyTypeFunc = context => context.GetRequestMessageType()
})
.Use<StageMarkerMiddleware>(StageMarkerOptions.For(RespondStage.MessageDeserialized))
.Use<HandlerInvokationMiddleware>(ResponseHandlerOptionFactory.Create()) })
.Use<HandlerInvocationMiddleware>(ResponseHandlerOptionFactory.Create()) })
.Use<ExplicitAckMiddleware>()
.Use<StageMarkerMiddleware>(StageMarkerOptions.For(RespondStage.HandlerInvoked))
.Use<BasicPropertiesMiddleware>(new BasicPropertiesOptions
Expand Down Expand Up @@ -105,7 +105,7 @@ public static Task RespondAsync<TRequest, TResponse>(
return tResponse.Result.AsUntyped();
}, ct);

ctx.Properties.Add(RespondKey.IncommingMessageType, typeof(TRequest));
ctx.Properties.Add(RespondKey.IncomingMessageType, typeof(TRequest));
ctx.Properties.Add(RespondKey.OutgoingMessageType, typeof(TResponse));
ctx.Properties.Add(PipeKey.MessageHandler, genericHandler);
context?.Invoke(ctx);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static class TriggerFromMessageExtension
.Use<ModelIdMiddleware>()
.Use<GlobalLockMiddleware>()
.Use<RetrieveStateMachineMiddleware>()
.Use<HandlerInvokationMiddleware>(new HandlerInvokationOptions
.Use<HandlerInvocationMiddleware>(new HandlerInvocationOptions
{
HandlerArgsFunc = context => context.GetLazyHandlerArgs()
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

namespace RawRabbit.Operations.Subscribe.Middleware
{
public class SubscribeInvokationMiddleware : HandlerInvokationMiddleware
public class SubscribeInvocationMiddleware : HandlerInvocationMiddleware
{
public SubscribeInvokationMiddleware() : base(new HandlerInvokationOptions
public SubscribeInvocationMiddleware() : base(new HandlerInvocationOptions
{
HandlerArgsFunc = context => new []{ context.GetMessage()}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static class SubscribeMessageExtension
.Use<SubscriptionExceptionMiddleware>(new SubscriptionExceptionOptions { InnerPipe = p => p
.Use<BodyDeserializationMiddleware>()
.Use<StageMarkerMiddleware>(StageMarkerOptions.For(StageMarker.MessageDeserialized))
.Use<SubscribeInvokationMiddleware>()})
.Use<SubscribeInvocationMiddleware>()})
.Use<ExplicitAckMiddleware>()
.Use<StageMarkerMiddleware>(StageMarkerOptions.For(StageMarker.HandlerInvoked));

Expand Down
2 changes: 1 addition & 1 deletion src/RawRabbit.Operations.Tools/BasicConsumeExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static Task BasicConsumeAsync(this IBusClient busClient, Func<BasicDelive
.Use<ConsumerMessageHandlerMiddleware>(new ConsumeOptions
{
Pipe = p => p
.Use<HandlerInvokationMiddleware>(new HandlerInvokationOptions
.Use<HandlerInvocationMiddleware>(new HandlerInvocationOptions
{
HandlerArgsFunc = ctx => new object[] { ctx.GetDeliveryEventArgs()},
})
Expand Down
10 changes: 5 additions & 5 deletions src/RawRabbit/Pipe/Middleware/ExplicitAckMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class ExplicitAckOptions
public Func<IPipeContext, IBasicConsumer> ConsumerFunc { get; set; }
public Func<IPipeContext, BasicDeliverEventArgs> DeliveryArgsFunc { get; set; }
public Func<IPipeContext, bool> AutoAckFunc { get; set; }
public Func<IPipeContext, Task> InvokationResultFunc { get; set; }
public Func<IPipeContext, Task> InvocationResultFunc { get; set; }
public Predicate<Acknowledgement> AbortExecution { get; set; }
}

Expand All @@ -29,7 +29,7 @@ public class ExplicitAckMiddleware : Middleware
protected readonly IChannelFactory ChannelFactory;
protected Func<IPipeContext, BasicDeliverEventArgs> DeliveryArgsFunc;
protected Func<IPipeContext, IBasicConsumer> ConsumerFunc;
protected Func<IPipeContext, Task> InvokationResultFunc;
protected Func<IPipeContext, Task> InvocationResultFunc;
protected Predicate<Acknowledgement> AbortExecution;
protected Func<IPipeContext, bool> AutoAckFunc;

Expand All @@ -40,7 +40,7 @@ public ExplicitAckMiddleware(INamingConventions conventions, ITopologyProvider t
ChannelFactory = channelFactory;
DeliveryArgsFunc = options?.DeliveryArgsFunc ?? (context => context.GetDeliveryEventArgs());
ConsumerFunc = options?.ConsumerFunc ?? (context => context.GetConsumer());
InvokationResultFunc = options?.InvokationResultFunc ?? (context => context.GetMessageHandlerResult());
InvocationResultFunc = options?.InvocationResultFunc ?? (context => context.GetMessageHandlerResult());
AbortExecution = options?.AbortExecution ?? (ack => !(ack is Ack));
AutoAckFunc = options?.AutoAckFunc ?? (context => context.GetConsumeConfiguration().AutoAck);
}
Expand All @@ -61,10 +61,10 @@ public override async Task InvokeAsync(IPipeContext context, CancellationToken t

protected virtual async Task<Acknowledgement> AcknowledgeMessageAsync(IPipeContext context)
{
var ack = (InvokationResultFunc(context) as Task<Acknowledgement>)?.Result;
var ack = (InvocationResultFunc(context) as Task<Acknowledgement>)?.Result;
if (ack == null)
{
throw new NotSupportedException($"Invokation Result of Message Handler not found.");
throw new NotSupportedException($"Invocation Result of Message Handler not found.");
}
var deliveryArgs = DeliveryArgsFunc(context);
var channel = ConsumerFunc(context).Model;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@

namespace RawRabbit.Pipe.Middleware
{
public class HandlerInvokationOptions
public class HandlerInvocationOptions
{
public Func<IPipeContext, Func<object[], Task>> MessageHandlerFunc { get; set; }
public Func<IPipeContext, object[]> HandlerArgsFunc { get; set; }
public Action<IPipeContext, Task> PostInvokeAction { get; set; }
}

public class HandlerInvokationMiddleware : Middleware
public class HandlerInvocationMiddleware : Middleware
{
protected Func<IPipeContext, object[]> HandlerArgsFunc;
protected Action<IPipeContext, Task> PostInvokeAction;
protected Func<IPipeContext, Func<object[], Task>> MessageHandlerFunc;

public HandlerInvokationMiddleware(HandlerInvokationOptions options = null)
public HandlerInvocationMiddleware(HandlerInvocationOptions options = null)
{
HandlerArgsFunc = options?.HandlerArgsFunc ?? (context => context.GetMessageHandlerArgs()) ;
MessageHandlerFunc = options?.MessageHandlerFunc ?? (context => context.GetMessageHandler());
Expand Down

0 comments on commit 4cf8ba0

Please sign in to comment.