ULinkActor 0.5.16

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package ULinkActor --version 0.5.16
                    
NuGet\Install-Package ULinkActor -Version 0.5.16
                    
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="ULinkActor" Version="0.5.16" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ULinkActor" Version="0.5.16" />
                    
Directory.Packages.props
<PackageReference Include="ULinkActor" />
                    
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 ULinkActor --version 0.5.16
                    
#r "nuget: ULinkActor, 0.5.16"
                    
#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 ULinkActor@0.5.16
                    
#: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=ULinkActor&version=0.5.16
                    
Install as a Cake Addin
#tool nuget:?package=ULinkActor&version=0.5.16
                    
Install as a Cake Tool

ULinkActor

ULinkActor is a lightweight actor/mailbox runtime for .NET game servers.

It focuses on single-process service runtime scenarios where long-lived state objects should process messages sequentially without locks.

Install

<ItemGroup>
  <PackageReference Include="ULinkActor" Version="0.5.1" />
</ItemGroup>

Quick Start

Define a message family and an actor:

using ULinkActor;

public abstract record RoomMessage;

public sealed record JoinRoom(long PlayerId) : RoomMessage;

public sealed class RoomActor : IActor<RoomMessage>
{
    private readonly HashSet<long> players = new();

    public ValueTask OnMessage(ActorContext<RoomMessage> ctx, RoomMessage message)
    {
        if (message is JoinRoom join)
        {
            players.Add(join.PlayerId);
        }

        return ValueTask.CompletedTask;
    }
}

Spawn the actor and send messages:

using ULinkActor;

await using ActorSystem system = new();

ActorHandle<RoomMessage> room = await system.SpawnAsync<RoomMessage>(new RoomActor());

await room.Ref.Send(new JoinRoom(10001));

Request / Response

Use Call<T> when the sender needs a response:

public sealed record GetPlayerCount : RoomMessage;

public sealed class RoomActor : IActor<RoomMessage>
{
    private readonly HashSet<long> players = new();

    public ValueTask OnMessage(ActorContext<RoomMessage> ctx, RoomMessage message)
    {
        if (message is GetPlayerCount)
        {
            ctx.Respond(players.Count);
        }

        return ValueTask.CompletedTask;
    }
}

ActorCallOptions callOptions = new(
    QueueTimeout: TimeSpan.FromMilliseconds(50),
    ResponseTimeout: TimeSpan.FromSeconds(1));

int count = await room.Ref.Call<int>(new GetPlayerCount(), callOptions);

Generated typed spawn extension methods are included with the ULinkActor package as compile-time source generator output.

Interfaces marked with [ActorClient] can also get generated client proxies that lower ValueTask methods into Send and ValueTask<T> methods into Call<T>.

The package also includes compile-time analyzer warnings for actor self-calls, blocking waits inside actor types, common blocking APIs such as Thread.Sleep, and discarded Call<T> request results.

Core Features

  • One actor owns one mailbox.
  • Messages are processed sequentially inside each actor.
  • Send supports fire-and-forget messaging.
  • Call<T> supports request/response workflows with distinct queue and response timeouts through ActorCallOptions.
  • ActorRef<TMessage> is message-only; ActorHandle<TMessage> owns lifecycle and diagnostics.
  • Timer messages enter the actor mailbox and follow the same sequential execution rule.
  • Optional IActorStarted<TMessage> and IActorStopping<TMessage> hooks support local startup and graceful stop work. During explicit stop, IActorStopping<TMessage> runs as the final mailbox turn after queued messages drain.
  • Bounded mailbox capacity provides backpressure.
  • The runtime does not preempt a running actor turn. Slow-message diagnostics report long handlers without allowing the mailbox to advance concurrently.
  • ActorState enum (Active / Draining / Dead) exposed via ActorHandle.GetState() and ActorSystem.GetActorState().
  • IActorMessageInterceptor hooks before and after every message dispatch. Interceptor failures are reported through observer-error diagnostics and do not change actor message results.
  • Circular actor call chains throw InvalidOperationException synchronously.
  • Named actors can be registered and resolved inside an ActorSystem; lookup validates the expected message type.
  • Mailbox metrics, slow message detection, dead letters, observer errors, and .NET ActivitySource tracing are available for diagnostics. Diagnostic events expose message/request type names rather than payload objects.

Non-Goals

ULinkActor is not a distributed actor platform. It does not provide cluster, remote actor, virtual actor, persistence, event sourcing, supervisor tree, networking, RPC, database, ORM, Unity integration, or MMO template features.

Those concerns should live in higher-level infrastructure or application code.

License

MIT

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on ULinkActor:

Package Downloads
ULinkGame.Server

Server-side actor runtime, RPC hosting helpers, session lifecycle, and reliable push infrastructure for ULinkGame applications.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated