Skip to content

Commit 2cb8b5a

Browse files
authored
Merge pull request #8 from tgiachi/develop
release: templating, messaging pub/sub, and the workers system
2 parents 10aa940 + 3519e08 commit 2cb8b5a

82 files changed

Lines changed: 3272 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ block until cancellation for long-running hosts.
8686
| `SquidStd.Storage` | Local file storage backend (`AddFileStorage`). | [![readme](https://img.shields.io/badge/readme-1390A3.svg)](src/SquidStd.Storage/README.md) · [![NuGet](https://img.shields.io/nuget/v/SquidStd.Storage.svg)](https://www.nuget.org/packages/SquidStd.Storage/) |
8787
| `SquidStd.Storage.S3` | S3/MinIO storage backend (`AddS3Storage`). | [![readme](https://img.shields.io/badge/readme-1390A3.svg)](src/SquidStd.Storage.S3/README.md) · [![NuGet](https://img.shields.io/nuget/v/SquidStd.Storage.S3.svg)](https://www.nuget.org/packages/SquidStd.Storage.S3/) |
8888
| `SquidStd.Scripting.Lua` | Lua scripting engine with attribute-based modules and event bridging. | [![readme](https://img.shields.io/badge/readme-1390A3.svg)](src/SquidStd.Scripting.Lua/README.md) · [![NuGet](https://img.shields.io/nuget/v/SquidStd.Scripting.Lua.svg)](https://www.nuget.org/packages/SquidStd.Scripting.Lua/) |
89+
| `SquidStd.Templating` | Scriban templating with a named-template registry and `templates/*.tmpl` auto-load (`AddTemplating`). | [![readme](https://img.shields.io/badge/readme-1390A3.svg)](src/SquidStd.Templating/README.md) · [![NuGet](https://img.shields.io/nuget/v/SquidStd.Templating.svg)](https://www.nuget.org/packages/SquidStd.Templating/) |
8990

9091
## Architecture
9192

SquidStd.slnx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
<Project Path="src/SquidStd.Storage.Abstractions/SquidStd.Storage.Abstractions.csproj" />
1919
<Project Path="src/SquidStd.Storage.S3/SquidStd.Storage.S3.csproj" />
2020
<Project Path="src/SquidStd.Storage/SquidStd.Storage.csproj" />
21+
<Project Path="src/SquidStd.Templating/SquidStd.Templating.csproj" />
22+
<Project Path="src/SquidStd.Workers.Abstractions/SquidStd.Workers.Abstractions.csproj" />
23+
<Project Path="src/SquidStd.Workers/SquidStd.Workers.csproj" />
24+
<Project Path="src/SquidStd.Workers.Manager/SquidStd.Workers.Manager.csproj" />
2125
</Folder>
2226
<Folder Name="/tests/">
2327
<Project Path="tests/SquidStd.Tests/SquidStd.Tests.csproj" />

docs/articles/templating.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[!include[](../../src/SquidStd.Templating/README.md)]

docs/articles/toc.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@
3636
href: storage-s3.md
3737
- name: SquidStd.Scripting.Lua
3838
href: scripting-lua.md
39+
- name: SquidStd.Templating
40+
href: templating.md
41+
- name: SquidStd.Workers.Abstractions
42+
href: workers-abstractions.md
43+
- name: SquidStd.Workers
44+
href: workers.md
45+
- name: SquidStd.Workers.Manager
46+
href: workers-manager.md
3947
- name: Serialization
4048
href: serialization.md
4149
- name: Scheduler
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[!include[](../../src/SquidStd.Workers.Abstractions/README.md)]

docs/articles/workers-manager.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[!include[](../../src/SquidStd.Workers.Manager/README.md)]

docs/articles/workers.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[!include[](../../src/SquidStd.Workers/README.md)]
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using SquidStd.Core.Interfaces.Events;
2+
3+
namespace SquidStd.Messaging.Abstractions.Data.Events;
4+
5+
/// <summary>
6+
/// Event published on the in-process event bus when a topic message is bridged. <see cref="Data" /> is the
7+
/// deserialized message.
8+
/// </summary>
9+
public sealed record TopicMessageEvent(string Topic, object Data) : IEvent;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
namespace SquidStd.Messaging.Abstractions.Interfaces;
2+
3+
/// <summary>
4+
/// Typed facade for publishing to and subscribing to topics (fan-out).
5+
/// </summary>
6+
public interface IMessageTopic
7+
{
8+
/// <summary>Publishes a typed message to a topic.</summary>
9+
Task PublishAsync<TMessage>(string topic, TMessage message, CancellationToken cancellationToken = default);
10+
11+
/// <summary>Subscribes a typed handler to a topic. Dispose to unsubscribe.</summary>
12+
IDisposable Subscribe<TMessage>(string topic, Func<TMessage, CancellationToken, Task> handler);
13+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
namespace SquidStd.Messaging.Abstractions.Interfaces;
2+
3+
/// <summary>
4+
/// Bridges a topic into the in-process event bus: each message of type <c>T</c> on the topic is republished
5+
/// as a <c>TopicMessageEvent</c>.
6+
/// </summary>
7+
public interface ITopicEventBridge
8+
{
9+
/// <summary>Starts bridging the given topic; dispose the result to stop.</summary>
10+
IDisposable Bridge<T>(string topic);
11+
}

0 commit comments

Comments
 (0)