AppChirp 0.0.4

dotnet add package AppChirp --version 0.0.4
                    
NuGet\Install-Package AppChirp -Version 0.0.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AppChirp" Version="0.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AppChirp" Version="0.0.4" />
                    
Directory.Packages.props
<PackageReference Include="AppChirp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AppChirp --version 0.0.4
                    
#r "nuget: AppChirp, 0.0.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AppChirp@0.0.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AppChirp&version=0.0.4
                    
Install as a Cake Addin
#tool nuget:?package=AppChirp&version=0.0.4
                    
Install as a Cake Tool

AppChirp

專案簡介

AppChirp 是一個用於程式內訊息傳遞的 .NET 套件,支援事件型態的即時訊息發送與接收,適合應用於模組間解耦、訊息推播等場景。

主要功能

  • 註冊與管理事件源(Event Source)
  • 即時訊息傳送與接收
  • 支援 DI(相依性注入)
  • 易於擴充與整合

安裝方式

請透過 NuGet 安裝 AppChirp 套件: dotnet add package AppChirp 或於 Visual Studio 的 NuGet 管理器搜尋 AppChirp 進行安裝。

用法說明

1. 註冊 AppChirp 與事件源

Program.cs 或 DI 註冊階段加入:

services.AddAppChirp(config =>
    config.RegisterEventSource<string>("demo"));

2. 取得事件發送者並發送訊息

var eventBus = serviceProvider.GetRequiredService<IEventBus>();
var publisher = eventBus.GetEventPublisher<string>("demo");
await publisher?.PublishAsync("Hello, AppChirp!");

3. 監聽事件訊息

var observable = eventBus.GetEventObserable<string>("demo");
observable?.Subscribe(msg => Console.WriteLine($"Received: {msg}"));

4. 在 ASP.NET Core 專案中使用(範例)

builder.Services.AddAppChirp(config => config.RegisterEventSource<string>("demo"));
builder.Services.AddKeyedSingleton(
    "demo",
    (sp, _) => sp.GetRequiredService<IEventBus>().GetEventPublisher<string>("demo")!);

貢獻方式

歡迎提出 issue 或 pull request,請遵循專案的貢獻指南。

授權

本專案採用 MIT 授權。

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.4 288 6/19/2025
0.0.3 141 6/19/2025
0.0.2 142 6/19/2025
0.0.1 141 6/19/2025