Asterisk.Sdk.Push
1.15.3
dotnet add package Asterisk.Sdk.Push --version 1.15.3
NuGet\Install-Package Asterisk.Sdk.Push -Version 1.15.3
<PackageReference Include="Asterisk.Sdk.Push" Version="1.15.3" />
<PackageVersion Include="Asterisk.Sdk.Push" Version="1.15.3" />
<PackageReference Include="Asterisk.Sdk.Push" />
paket add Asterisk.Sdk.Push --version 1.15.3
#r "nuget: Asterisk.Sdk.Push, 1.15.3"
#:package Asterisk.Sdk.Push@1.15.3
#addin nuget:?package=Asterisk.Sdk.Push&version=1.15.3
#tool nuget:?package=Asterisk.Sdk.Push&version=1.15.3
Asterisk.Sdk.Push
Real-time push primitives for .NET. AOT-safe, host-agnostic, MIT licensed.
What it does
- Typed, in-memory event bus (
IPushEventBus) backed by a boundedSystem.Threading.Channels.Channel<T>with configurable backpressure. - Delivery filter (
IEventDeliveryFilter) that enforces tenant isolation and optional per-user targeting before an event reaches a subscriber. - Subscription registry (
ISubscriptionRegistry) for tracking active subscribers per tenant with automatic cleanup on disposal. - First-class diagnostics via
System.Diagnostics.Metrics(meter nameAsterisk.Sdk.Push).
No ASP.NET Core dependency. No reflection. Trim-safe.
Install
dotnet add package Asterisk.Sdk.Push
Quick start
using Asterisk.Sdk.Push.Bus;
using Asterisk.Sdk.Push.Delivery;
using Asterisk.Sdk.Push.Events;
using Asterisk.Sdk.Push.Hosting;
using Asterisk.Sdk.Push.Subscriptions;
using Microsoft.Extensions.DependencyInjection;
// 1) Define a concrete event
public sealed record ConversationAssigned : PushEvent
{
public required string ConversationId { get; init; }
public override string EventType => "conversation.assigned";
}
// 2) Register services
var services = new ServiceCollection();
services.AddLogging();
services.AddAsteriskPush(options =>
{
options.BufferCapacity = 512;
options.BackpressureStrategy = BackpressureStrategy.DropOldest;
});
using var sp = services.BuildServiceProvider();
var bus = sp.GetRequiredService<IPushEventBus>();
var filter = sp.GetRequiredService<IEventDeliveryFilter>();
var registry = sp.GetRequiredService<ISubscriptionRegistry>();
// 3) Register a subscriber and subscribe to a typed stream
var subscriber = new SubscriberContext(
TenantId: "tenant-1",
UserId: "user-42",
Roles: new HashSet<string> { "agent" },
Permissions: new HashSet<string> { "conversation:read" });
using var _registration = registry.Register(subscriber);
using var subscription = bus.OfType<ConversationAssigned>().Subscribe(evt =>
{
if (filter.IsDeliverableToSubscriber(evt, subscriber))
{
Console.WriteLine($"{evt.EventType}: {evt.ConversationId}");
}
});
// 4) Publish
await bus.PublishAsync(new ConversationAssigned
{
ConversationId = "c-123",
Metadata = new PushEventMetadata(
TenantId: "tenant-1",
UserId: "user-42",
OccurredAt: DateTimeOffset.UtcNow,
CorrelationId: null),
});
Contract
PushEventBusOptions
| Setting | Default | Description |
|---|---|---|
BufferCapacity |
256 |
Max in-flight events before the backpressure strategy kicks in. Must be >= 1. |
BackpressureStrategy |
DropOldest |
Behavior when the buffer is full. |
BackpressureStrategy
DropOldest(default) — evict the oldest buffered event to make room for the new one. Favors freshness; appropriate for live UI streams where stale events are worthless.DropNewest— refuse to enqueue the new event, preserving the buffered backlog. Favors FIFO ordering.Block— await buffer space. Use only when publishers can tolerate backpressure (batch pipelines, not hot request paths).
Dropped events increment asterisk.push.events.dropped with a reason="buffer_full" tag.
Observability
The package exposes a System.Diagnostics.Metrics.Meter named Asterisk.Sdk.Push with the following instruments:
| Instrument | Kind | Description |
|---|---|---|
asterisk.push.events.published |
Counter<long> | Events accepted by PublishAsync. |
asterisk.push.events.delivered |
Counter<long> | Events dispatched to at least one observer. |
asterisk.push.events.dropped |
Counter<long> | Events discarded (tag: reason=buffer_full\|filter_rejected). |
asterisk.push.subscribers.active |
ObservableGauge<int> | Current active subscriptions (bound via PushMetrics.BindActiveSubscribersGauge). |
Wire into OpenTelemetry with meterProvider.AddMeter("Asterisk.Sdk.Push").
AOT
This package is Native AOT compatible. The shipping build verifies zero trim warnings (IL2026 / IL2070 / IL2075 / IL3050 / ...) via the repo's AotCanary publish (tools/verify-aot.sh). No reflection, no DataAnnotations runtime validator, no dynamic code.
Relation with Asterisk.Sdk.Pro.Push
This package provides in-memory primitives suitable for single-node hosts. For NATS-backed multi-node fan-out in the MIT surface, see Asterisk.Sdk.Push.Nats (available since v1.12). For cluster-wide subscription routing over durable backplanes (Redis / Postgres LISTEN/NOTIFY), advanced authorization, and enterprise observability, see Asterisk.Sdk.Pro.Push — both build on top of this package's abstractions, so the contract is forward-compatible.
Links
- Repository: github.com/ipcom/Asterisk.Sdk
- Parent SDK README: ../../README.md
- Changelog: ../../CHANGELOG.md
Licensed under the MIT License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.7)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.7)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.7)
- Microsoft.Extensions.Options (>= 10.0.7)
- System.Reactive (>= 6.1.0)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Asterisk.Sdk.Push:
| Package | Downloads |
|---|---|
|
Asterisk.Sdk.Push.AspNetCore
Asterisk.Sdk.Push.AspNetCore - SSE push delivery endpoints for ASP.NET Core. Maps IPushEventBus events to Server-Sent Events with topic filtering and JWT authorization. |
|
|
Asterisk.Sdk.Push.Webhooks
Asterisk.Sdk.Push.Webhooks - outbound HTTP webhook delivery for Asterisk.Sdk.Push. Consumes events from the Push bus, matches against WebhookSubscription topic patterns, POSTs with HMAC-SHA256 signature and exponential retry/backoff. AOT-safe. |
|
|
Asterisk.Sdk.Push.Nats
Asterisk.Sdk.Push.Nats - publishes Push bus events to a NATS subject hierarchy that mirrors the Push topic tree (asterisk.sdk.**). AOT-safe. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 1.15.3 | 138 | 5/3/2026 | |
| 1.15.2 | 137 | 4/27/2026 | |
| 1.15.1 | 164 | 4/26/2026 | |
| 1.15.0 | 207 | 4/20/2026 | |
| 1.14.0 | 147 | 4/20/2026 | |
| 1.13.0 | 150 | 4/20/2026 | |
| 1.12.0 | 156 | 4/19/2026 | |
| 1.11.1 | 141 | 4/19/2026 | |
| 1.11.0 | 146 | 4/19/2026 | |
| 1.10.2 | 136 | 4/18/2026 | |
| 1.10.1 | 130 | 4/18/2026 | |
| 1.10.0 | 146 | 4/18/2026 | |
| 1.9.0 | 138 | 4/17/2026 | |
| 1.8.1 | 133 | 4/16/2026 | |
| 1.8.0 | 138 | 4/13/2026 | |
| 1.7.0 | 123 | 4/13/2026 | |
| 1.6.0 | 118 | 4/13/2026 |