Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Auto detect text files and perform LF normalization
* text=auto

*.cs text diff=csharp
*.cshtml text diff=html
*.csx text diff=csharp
*.sln text eol=crlf
*.slnx text eol=crlf
*.csproj text eol=crlf
6 changes: 3 additions & 3 deletions samples/AwsTaskQueue/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@
.SetMessagePumpType(MessagePumpType.Proactor)
.SetMakeChannels(OnMissingChannel.Create))
)
// .UseDynamoDbOutbox()
// .UseDynamoDbInbox()
// .UseDynamoDbOutbox()
// .UseDynamoDbInbox()
));
})
.Build();


await host.StartAsync();

using var cts = new CancellationTokenSource();
using var cts = new CancellationTokenSource();

Console.CancelKeyPress += (_, _) => cts.Cancel();

Expand Down
4 changes: 2 additions & 2 deletions samples/GcpSample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

await host.StartAsync();

using var cts = new CancellationTokenSource();
using var cts = new CancellationTokenSource();

Console.CancelKeyPress += (_, _) => cts.Cancel();

Expand All @@ -86,4 +86,4 @@
}


await host.StopAsync();
await host.StopAsync();
6 changes: 3 additions & 3 deletions samples/MongoDbSample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
.UsePublications(pb => pb
.AddPublication<GreetingEvent>(p => p
.SetTopic("greeting.event.topic")
.CreateTopicIfMissing())
.CreateTopicIfMissing())
.AddPublication<FarewellEvent>(p => p
.SetTopic("farewell.event.topic")
.CreateTopicIfMissing())
.CreateTopicIfMissing())
)
.UseSubscriptions(sb => sb
.AddSubscription<GreetingEvent>(s => s
Expand Down Expand Up @@ -80,4 +80,4 @@
}


await host.StopAsync();
await host.StopAsync();
4 changes: 2 additions & 2 deletions samples/RedisSample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
.SetTopic("farewell.topic")
.SetQueue("farewell.queue")
.SetMessagePumpType(MessagePumpType.Reactor)));
});
});
});
})
.Build();
Expand Down Expand Up @@ -77,4 +77,4 @@
await process.PostAsync(new FarewellEvent(name));
}

await host.StopAsync();
await host.StopAsync();
4 changes: 2 additions & 2 deletions samples/RmqTaskQueue/Mappers/FarewellEventMessageMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace RmqTaskQueue.Mappers;
public class FarewellEventMessageMapper : IAmAMessageMapperAsync<FarewellEvent>
{
public IRequestContext? Context { get; set; }

public Task<Message> MapToMessageAsync(FarewellEvent request, Publication publication, CancellationToken ct = default)
{
var header = new MessageHeader(
Expand All @@ -30,4 +30,4 @@ public Task<FarewellEvent> MapToRequestAsync(Message message, CancellationToken
var farewellCommand = JsonSerializer.Deserialize<FarewellEvent>(message.Body.Bytes, JsonSerialisationOptions.Options)!;
return Task.FromResult(farewellCommand);
}
}
}
2 changes: 1 addition & 1 deletion samples/RmqTaskQueue/Mappers/GreetingEventMessageMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace RmqTaskQueue.Mappers;
public class GreetingEventMessageMapper : IAmAMessageMapperAsync<GreetingEvent>
{
public IRequestContext? Context { get; set; }

public Task<Message> MapToMessageAsync(GreetingEvent request, Publication publication, CancellationToken ct = default)
{
var header = new MessageHeader(messageId: request.Id, topic: "greeting.event", messageType: MessageType.MT_EVENT);
Expand Down
4 changes: 2 additions & 2 deletions samples/RmqTaskQueue/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
.UsePublications(pb => pb
.AddPublication<GreetingEvent>(p => p
.SetTopic("greeting.event.topic")
.CreateTopicIfMissing())
.CreateTopicIfMissing())
.AddPublication<FarewellEvent>(p => p
.SetTopic("farewell.event.topic")
.CreateTopicIfMissing())
.CreateTopicIfMissing())
)
.UseSubscriptions(sb => sb
.AddSubscription<GreetingEvent>(s => s
Expand Down
2 changes: 1 addition & 1 deletion samples/RocketMqSample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
))));
})
.Build();

await host.StartAsync();

while (true)
Expand Down
8 changes: 4 additions & 4 deletions samples/SqlServerSample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ [Topic] ASC
.UseOutboxSweeper()
.UsingMicrosoftSqlServer(cfg =>
{
cfg.SetConnection(new RelationalDatabaseConfiguration(ConnectionString,
databaseName: "BrighterTests",
cfg.SetConnection(new RelationalDatabaseConfiguration(ConnectionString,
databaseName: "BrighterTests",
queueStoreTable: "QueueData"));

cfg
Expand All @@ -134,7 +134,7 @@ [Topic] ASC
.AddSubscription<FarewellEvent>(s => s
.SetQueue("farewell.queue")
.SetMessagePumpType(MessagePumpType.Reactor)));
});
});
});
})
.Build();
Expand Down Expand Up @@ -162,4 +162,4 @@ [Topic] ASC
await process.PostAsync(new FarewellEvent(name));
}

await host.StopAsync();
await host.StopAsync();
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static SchedulerFactoryBuilder SetConnection(this SchedulerFactoryBuilder
}

#region Group

/// <summary>
/// Sets the scheduler group configuration using a builder pattern for fluent configuration.
/// </summary>
Expand Down Expand Up @@ -81,7 +81,7 @@ public static SchedulerFactoryBuilder DisableMessageTopicAsTarget(this Scheduler
#endregion

#region On conflict

/// <summary>
/// Configures the scheduler to throw an exception when scheduling conflicts occur.
/// </summary>
Expand All @@ -105,7 +105,7 @@ public static SchedulerFactoryBuilder OverwriteOnConflict(this SchedulerFactoryB
#endregion

#region On missing role

/// <summary>
/// Configures the scheduler to assume the IAM role exists (no validation or creation).
/// </summary>
Expand Down Expand Up @@ -137,4 +137,4 @@ public static SchedulerFactoryBuilder ValidateRoleIfMissing(this SchedulerFactor
}

#endregion
}
}
18 changes: 9 additions & 9 deletions src/Fluent.Brighter.AWS.V4/SchedulerFactoryBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public SchedulerFactoryBuilder SetRole(string role)
}

private TimeProvider _timeProvider = TimeProvider.System;

/// <summary>
/// Sets the time provider for scheduling operations, allowing for custom time sources
/// in testing scenarios or for time synchronization requirements.
Expand All @@ -54,7 +54,7 @@ public SchedulerFactoryBuilder SetTimeProvider(TimeProvider timeProvider)
}

private SchedulerGroup _group = new();

/// <summary>
/// Sets the scheduler group for organizing and managing related schedules.
/// </summary>
Expand All @@ -67,7 +67,7 @@ public SchedulerFactoryBuilder SetGroup(SchedulerGroup group)
}

private Func<Message, string> _getOrCreteMessageSchedulerId = static _ => Uuid.New().ToString("N");

/// <summary>
/// Sets the function to generate or retrieve a unique scheduler ID for messages.
/// </summary>
Expand All @@ -80,7 +80,7 @@ public SchedulerFactoryBuilder SetGetOrCreateMessageSchedulerId(Func<Message, st
}

private Func<IRequest, string> _getOrCreteRequestSchedulerId = static _ => Uuid.New().ToString("N");

/// <summary>
/// Sets the function to generate or retrieve a unique scheduler ID for requests.
/// </summary>
Expand All @@ -93,7 +93,7 @@ public SchedulerFactoryBuilder SetGetOrCreateRequestSchedulerId(Func<IRequest, s
}

private int? _flexibleTimeWindowMinutes;

/// <summary>
/// Sets the flexible time window in minutes for schedule execution, which allows
/// AWS to execute the schedule within the specified window for better resource utilization.
Expand All @@ -107,7 +107,7 @@ public SchedulerFactoryBuilder SetFlexibleTimeWindowMinutes(int? flexibleTimeWin
}

private RoutingKey _schedulerTopicOrQueue = RoutingKey.Empty;

/// <summary>
/// Sets the topic or queue where scheduled messages will be delivered.
/// </summary>
Expand All @@ -120,7 +120,7 @@ public SchedulerFactoryBuilder SetSchedulerTopicOrQueue(RoutingKey schedulerTopi
}

private bool _useMessageTopicAsTarget = true;

/// <summary>
/// Sets whether to use the message's topic as the target for scheduled delivery.
/// </summary>
Expand All @@ -133,7 +133,7 @@ public SchedulerFactoryBuilder SetMessageTopicAsTarget(bool useMessageTopicAsTar
}

private OnSchedulerConflict _onConflict;

/// <summary>
/// Sets the conflict resolution strategy when scheduling conflicts occur.
/// </summary>
Expand All @@ -146,7 +146,7 @@ public SchedulerFactoryBuilder SetOnConflict(OnSchedulerConflict onConflict)
}

private OnMissingRole _missingRole = OnMissingRole.Assume;

/// <summary>
/// Sets the behavior when the specified IAM role is missing.
/// </summary>
Expand Down
6 changes: 3 additions & 3 deletions src/Fluent.Brighter.AWS.V4/SchedulerGroupBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Fluent.Brighter.AWS.V4;
public class SchedulerGroupBuilder
{
private string _name = "default";

/// <summary>
/// Sets the name of the scheduler group for organizing related schedules.
/// </summary>
Expand All @@ -27,7 +27,7 @@ public SchedulerGroupBuilder SetName(string name)
}

private List<Tag> _tags = [new Tag { Key = "Source", Value = "Brighter" }];

/// <summary>
/// Sets the tags for the scheduler group, which help with organization,
/// cost allocation, and access control in AWS.
Expand All @@ -52,7 +52,7 @@ public SchedulerGroupBuilder AddTag(Tag tag)
}

private OnMissingSchedulerGroup _makeSchedulerGroup = OnMissingSchedulerGroup.Assume;

/// <summary>
/// Sets the behavior when the scheduler group doesn't exist.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static SchedulerFactoryBuilder SetConnection(this SchedulerFactoryBuilder
}

#region Group

/// <summary>
/// Sets the scheduler group configuration using a builder pattern for fluent configuration.
/// </summary>
Expand Down Expand Up @@ -82,7 +82,7 @@ public static SchedulerFactoryBuilder DisableMessageTopicAsTarget(this Scheduler
#endregion

#region On conflict

/// <summary>
/// Configures the scheduler to throw an exception when scheduling conflicts occur.
/// </summary>
Expand All @@ -106,7 +106,7 @@ public static SchedulerFactoryBuilder OverwriteOnConflict(this SchedulerFactoryB
#endregion

#region On missing role

/// <summary>
/// Configures the scheduler to assume the IAM role exists (no validation or creation).
/// </summary>
Expand Down Expand Up @@ -138,4 +138,4 @@ public static SchedulerFactoryBuilder ValidateRoleIfMissing(this SchedulerFactor
}

#endregion
}
}
Loading
Loading