Changelog History
Page 8
-
v1.1.0 Changes
July 05, 2016๐ Feature Release for Akka.NET
In Akka.NET 1.1 we introduce the following major changes:
- ๐ Akka.Cluster is no longer in beta; it is released as a fully stable module with a frozen API that is ready for production use.
- Akka.Remote now has a new Helios 2.1 transport that is up to 5x faster than the previous implementation and with tremendously lower memory consumption.
- ๐จ The actor mailbox system has been replaced with the
MailboxType
system, which standardizes all mailbox implementations on a common core and instead allows for pluggableIMessageQueue
implementations. This will make it easier to develop user-defined mailboxes and also has the added benefit of reducing all actor memory footprints by 34%. - โก๏ธ The entire router system has been updated, including support for new "controller" actors that can be used to adjust a router's routing table in accordance to external events (i.e. a router that adjusts whom it routes to based on CPU utilization, which will be implemented in Akka.Cluster.Metrics).
๐ Full list of Akka.NET 1.1 fixes and changes
API Changes โฌ๏ธ There have been a couple of important API changes which will affect end-users upgrading from Akka.NET versions 1.0.*.
First breaking change deals with the
PriorityMailbox
base class, used by developers who need to prioritize specific message types ahead of others.All user-defined instances of this type must now include the following constructor in order to work (using an example from Akka.NET itself:)
public class IntPriorityMailbox : UnboundedPriorityMailbox { protected override int PriorityGenerator(object message) { return message as int? ?? Int32.MaxValue; } public IntPriorityMailbox(Settings settings, Config config) : base(settings, config) { } }
๐ง There must be a
MyMailboxType(Settings settings, Config config)
constructor on all custom mailbox types going forward, or aConfigurationException
will be thrown when trying to instantiate an actor who uses the mailbox type.Second breaking change deals with Akka.Cluster itself. In the past you could access all manner of data from the
ClusterReadView
class (accessed via theCluster.ReadView
property) - such as the addresses of all other members, who the current leader was, and so forth.๐ Going forward
ClusterReadView
is now marked asinternal
, but if you need access to any of this data you can access theCluster.State
property, which will return aCurrentClusterState
object. This contains most of the same information that was previously available onClusterReadView
.Akka.Streams ๐ Another major part of Akka.NET 1.1 is the introduction of Akka.Streams, a powerful library with a Domain-Specific Language (DSL) that allows you to compose Akka.NET actors and workflows into streams of events and messages.
As of 1.1 Akka.Streams is now available as a beta module on NuGet.
๐ We highly recommend that you read the Akka.Streams Quick Start Guide for Akka.NET as a place to get started.
Akka.Persistence.Query A second beta module is also now available as part of Akka.NET 1.1, Akka.Persistence.Query - this module is built on top of Akka.Streams and Akka.Persistence and allows users to query ranges of information directly from their underlying Akka.Persistence stores for more powerful types of reads, aggregations, and more.
๐ Akka.Persistence.Query is available for all SQL implementations of Akka.Persistence and will be added to our other Akka.Persistence plugins shortly thereafter.
Thank you! โ Thanks for all of your patience and support as we worked to deliver this to you - it's been a tremendous amount of work but we really appreciate the help of all of the bug reports, Gitter questions, StackOverflow questions, and testing that our users have done on Akka.NET and specifically, Akka.Cluster over the past two years. We couldn't have done this without you.
๐ 23 contributors since release v1.0.8
COMMITS LOC+ LOC- AUTHOR 133 38124 7835 Silv3rcircl3 112 25826 10493 Chris Constantin 70 45449 11556 Bartosz Sypytkowski 44 22804 13971 ravengerUA 40 9811 6396 Aaron Stannard 12 9539 6619 Marc Piechura 6 1692 959 Sean Gilliam 4 448 0 alexpantyukhin 3 772 4 maxim.salamatko 3 3 382 Danthar 2 40 46 Vagif Abilov 1 91 103 rogeralsing 1 3 3 Jeff Cyr 1 219 44 Michael Kantarovsky 1 2 1 Juergen Hoetzel 1 19 8 tstojecki 1 187 2 Bart de Boer 1 178 0 Willem Meints 1 17 1 Kamil Wojciechowski 1 120 7 JeffCyr 1 11 7 corneliutusnea 1 1 1 Tamas Vajk 1 0 64 annymsMthd -
v1.0.8 Changes
April 26, 2016๐ Maintenance release for Akka.NET v1.0.7
๐ Fixes an issue with the 1.0.7 release where the default settings for Akka.Persistence changed and caused potential breaking changes for Akka.Persistence users. Those changes have been reverted back to the same values as previous versions.
๐ General fixes:
- 0๏ธโฃ Recovered default journal & snapshot store to default config
- ๐ EndpointRegistry fixes
- eliminated allocations with StandardOutWriter
- โก๏ธ ClusterSingletonManager - settings update
- Implement spec for standard mailbox combinations in Akka.NET
Commit Stats for v1.0.8 | COMMITS | LOC+ | LOC- | AUTHOR | | --- | --- | --- | --- | | 4 | 240 | 59 | Aaron Stannard | | 3 | 268 | 1 | Danthar | | 3 | 189 | 2810 | Silv3rcircl3 | | 2 | 204 | 4 | Willem Meints | | 2 | 161 | 108 | Bartosz Sypytkowski | | 2 | 101 | 24 | Sean Gilliam | | 1 | 25 | 16 | zbynek001 |
-
v1.0.7 Changes
April 04, 2016๐ Maintenance release for Akka.NET v1.0.6 ๐ The biggest changes in Akka.NET 1.0.7 have been made to Akka.Persistence, which is now designed to match the final stable release version in JVM Akka 2.4. Akka.Persistence is on-target to exit beta and become a fully mature module as of Akka.NET 1.5, due in May/June timeframe.
0๏ธโฃ A quick note about 1.5 - JSON.NET will be replaced by Wire as the default serializer going forward, so if you want to be forward-compatible with 1.5 you will need to switch to using Wire today. Learn how to switch to using Wire as the default Akka.NET serializer.
๐ If you install 1.0.7 you may see the following warning appear:
0๏ธโฃ > NewtonSoftJsonSerializer has been detected as a default serializer.
It will be obsoleted in Akka.NET starting from version 1.5 in the favor of Wire 0๏ธโฃ for more info visit: http://getakka.net/docs/Serialization#how-to-setup-wire-as-default-serializer If you want to suppress this message set HOCON
{configPath}
config flag to on.๐ This release also fixes some issues with the Cluster.Tools and Cluster.Sharding NuGet packages, which weren't versioned correctly in previous releases.
๐ Fixes & Changes - Akka.NET Core
- https://github.com/akkadotnet/akka.net/pull/1667
- โ Akka IO: ByteIterator and ByteStringbuilder bug fixes
- ๐ Hocon Tripple quoted text - Fixes #1687
- โฌ๏ธ Downgrade System.Collections.Immutable to 1.1.36
- Unify immutable collections - Akka.NET core now depends on System.Collections.Immutable.
- โฑ #1694 Added safe check in InboxActor when receive timeout is already expired
- ๐ Bugfix: DeadLetter filter with Type parameter should call IsInstanceOfType with the correct argument
- Akka.IO bind failed must notify bindCommander of failure
- ReceiveActor: Replaced Receive(Func handler) by ReceiveAsync(...)
- โ External ActorSystem for Testkit event filters.
- ๐ Fixed the ScatterGatherFirstCompleted router logic
- Issue #1766 - Lazy evaluation of ChildrenContainer.Children and ChildrenContainer.Stats
- ๐ [Dispatch] Support for 'mailbox-requirement' and 'mailbox-type' in dispatcher config
- ๐ง Fixed within timeout for routers in default configuration
- 0๏ธโฃ Default MailboxType optimization
- โ Warning about JSON.NET obsolete in v1.5
- Issue #1828 Implemented NobodySurrogate
๐ Fixes & Changes - Akka.Remote, Akka.Cluster, Et al
- 0๏ธโฃ Add the default cluster singleton config as a top-level fallback.
- Change ShardState to a class
- ๐ง Cluster.Sharding: Take snapshots when configured
- added remote metrics
- โ Added a new argument to the MultiNodeTestRunner to filter specs
- close #1758 made Akka.Cluster.Tools and Akka.Cluster.Sharding use correct assembly version info and nuget dependencies
- ๐ Akka.Remote EndpointWriter backoff bugfix
- โ Akka.Cluster.TestKit (internal use only)
- Cluster.Tools.Singleton: Member.UpNumber fix
๐ Fixes & Changes - Akka.Persistence
- ๐ฐ Made JournalEntry.Payload an object and AtLeastOnceDeliverySemantic public
- โก๏ธ Akka.Persistence - update code base to akka JVM v2.4
- Ensure internal stash is unstashed on writes after recovery
- Wrap user stash to avoid confusion between PersistentActor.UnstashAll and PersistentActor.Stash.UnstashAll
- ๐ Fixes initialization of LocalSnapshotStore directory
- ๐ Fixed global ActorContext in SqlJournal
Commit Stats for v1.0.7
COMMITS LOC+ LOC- AUTHOR 12 1718 2213 Aaron Stannard 11 2187 2167 Silv3rcircl3 7 433 75 JeffCyr 6 2 1127 Danthar 6 10383 3054 Chris Constantin 3 510 25 maxim.salamatko 3 5 3 Christopher Martin 2 53 65 rogeralsing 2 50 1 mukulsinghsaini 2 2738 2035 Sean Gilliam 2 25 4 Bartosz Sypytkowski 2 2 2 utcnow 2 14 13 zbynek001 2 130 126 annymsMthd 1 58 0 Denis Kostikov 1 48 43 voltcode 1 213 66 Alex Koshelev 1 2 2 Tamas Vajk 1 2 2 Marc Piechura 1 2 1 Juergen Hoetzel 1 19 8 tstojecki 1 13 13 Willie Ferguson 1 1 1 ravengerUA -
v1.0.6 Changes
January 18, 2016๐ Maintenance release for Akka.NET v1.0.5 ๐ This patch consists of many bug fixes, performance improvements, as well as the addition of two brand new alpha modules for Akka.Cluster users.
Akka.Cluster.Tools and Akka.Cluster.Sharding ๐ The biggest part of this release is the addition of Akka.Cluster.Tools and Akka.Cluster.Sharding, both of which are available now as pre-release packages on NuGet.
PM> Install-Package Akka.Cluster.Tools -pre
and
PM> Install-Package Akka.Cluster.Sharding -pre
๐ฆ Respectively, these two packages extend Akka.Cluster to do the following:
- Distributed pub/sub (Akka.Cluster.Tools)
ClusterClient
- subscribe to changes in cluster availability without actually being part of the cluster itself. (Akka.Cluster.Tools)ClusterSingleton
- guarantee a single instance of a specific actor throughout the cluster. (Akka.Cluster.Tools)- Sharding - partition data into durable stores (built on top of Akka.Persistence) in a manner that is fault-tolerant and recoverable across thecluster. (Akka.Cluster.Sharding)
๐ Check out the documentation for more details!
- ๐ http://getakka.net/docs/clustering/cluster-tools
- ๐ http://getakka.net/docs/clustering/cluster-sharding
๐ Fixes & Changes - Akka.NET Core
- Fix incorrect serialization of Unicode characters in NewtonSoftJsonSerializer
- ๐ Fixed: Supervisorstrategy does not preserve stacktrace
- ๐ added initial performance specs using NBench
- ๐ฆ Add wire back as contrib package + Serialization TestKit
- Implemented the RegisterOnTermination feature.
- ๐ Increased performance of DedicatedThreadPool
- โก๏ธ #1605 updated Google.ProtocolBuffers to 2.4.1.555
- ๐ Clear current message - fixes #1609
- Rewrite of the AtomicReference
- Implemented WhenTerminated and Terminate
- Implemented StartTime and Uptime
- ๐ API Diff with fixed Approval file
- ๐ Fixed: NullReferenceException in Akka.Util.Internal.Collections.ImmutableAvlTreeBase`2.RotateLeft
๐ Fixes & Changes - Akka.Remote & Akka.Cluster It should be noted that we've improved the throughput from Akka.NET v1.0.5 to 1.0.6 by a factor of 8
- โ Akka.Cluster.Tools & Akka.Cluster.Sharding with tests and examples
- Added UntrustedSpec
- ๐ Akka.Remote Performance - String.Format logging perf fix
- โฌ๏ธ Remoting system upgrade
- 0๏ธโฃ PublicHostname defaults to IPAddress.Any when hostname is blank
- ๐ Removes code that overrides OFF log level with WARNING.
- ๐ fixes issue with Helios message ordering
- ๐ Fixed: Actor does not receive "Terminated" message if remoting is used and it is not monitored actor's parent
๐ Fixes & Changes - Akka.Persistence
- ๐ Fixed racing conditions on sql-based snapshot stores
- ๐ Fix for race conditions in presistence plugins
- ๐ Fix #1522 Ensure extensions and persistence plugins are only registered/created once
A special thanks to all of our contributors for making this happen! ๐ 18 contributors since release v1.0.5
COMMITS LOC+ LOC- AUTHOR 22 3564 28087 Aaron Stannard 15 1710 1303 rogeralsing 6 569 95 Silv3rcircl3 6 53594 4417 Bartosz Sypytkowski 5 1786 345 Sean Gilliam 3 786 159 maxim.salamatko 2 765 277 JeffCyr 2 44 53 Chris Constantin 2 14 2 Simon Anderson 1 84 4 Bart de Boer 1 6051 27 danielmarbach 1 6 2 tstojecki 1 3 5 Ralf1108 1 27 0 Andrew Skotzko 1 2 2 easuter 1 2 1 Danthar 1 182 0 derwasp 1 179 0 Onat Yigit Mercan -
v1.0.5 Changes
December 03, 2015๐ Maintenance release for Akka.NET v1.0.4 ๐ This release is a collection of bug fixes, performance enhancements, and general improvements contributed by 29 individual contributors.
๐ Fixes & Changes - Akka.NET Core
- ๐ Bugfix: Make the Put on the SimpleDnsCache idempotent
- Add CircuitBreaker Initial based on akka 2.0.5
- โฑ Fix for receive timeout in async await actor
- ๐ akka-io: fixed High CPU load using the Akka.IO TCP server
- akka-io: Stop select loop on idle
- ๐ Serialization fixes
- Fix issue #1301 - inprecise resizing of resizable routers
- Stashing now checks message equality by reference
- โ rewrote ActorPath.TryParseAddrss to now test Uris by try / catch and use Uri.TryCreate instead
- Port EventBusUnsubscribers
- Add optional PipeTo completion handlers
- Akka context props output to Serilog
๐ Fixes & Changes - Akka.Remote, Akka.Cluster
- โ MultiNode tests can now be skipped by specifying a SkipReason
- ๐ฐ Akka.Remote: Discard msg if payload size > max allowed.
- ๐ Throw
TypeLoadException
when an actor type or dependency cannot be found in a remote actor deploy scenario - โ MultiNode Test Visualizer
- ๐ง Fix for Akka.Cluster.Routing.ClusterRouterGroupSettings Mono Linux issue
- ๐ Added RemoteDeploymentWatcher
- ๐ Akka IO Transport: framing support
- #1443 fix for cluster shutdown
๐ Fixes & Changes - Akka.Persistence
- ๐ Fixes the NullReferenceException in #1235 and appears to adhere to the practice of including an addres with the serialized binary.
- Port Finite State Machine DSL to Akka.Persistence
- Become and BecomeStacked for ReceivePersistentActor
- Persistent actor stops on recovery failures
- ๐ Fixed: data races inside sql journal engine
- fix sqlite.conf and readme
- #1416 created ReceiveActor implementation of AtLeastOnceDeliveryActor base class
A special thanks to all of our contributors, organized below by the number of changes made:
23369 5258 18111 Aaron Stannard 18827 16329 2498 Bartosz Sypytkowski 11994 9496 2498 Steffen Forkmann 6031 4637 1394 maxim.salamatko 1987 1667 320 Graeme Bradbury 1556 1149 407 Sean Gilliam 1118 1118 0 moliver 706 370 336 rogeralsing 616 576 40 Marek Kadek 501 5 496 Alex Koshelev 377 269 108 Jeff Cyr 280 208 72 willieferguson 150 98 52 Christian Palmstierna 85 63 22 Willie Ferguson 77 71 6 Emil Ingerslev 66 61 5 Grover Jackson 60 39 21 Alexander Pantyukhin 56 33 23 Uladzimir Makarau 55 54 1 rdavisau 51 18 33 alex-kondrashov 42 26 16 Silv3rcircl3 36 30 6 evertmulder 33 19 14 Filip Malachowicz 13 11 2 Suhas Chatekar 7 6 1 tintoy 4 2 2 Jonathan 2 1 1 neekgreen 2 1 1 Christopher Martin 2 1 1 Artem Borzilov
-
v1.0.4 Changes
August 07, 2015๐ Maintenance release for Akka.NET v1.0.3
Akka.IO ๐ This release introduces some major new features to Akka.NET, including Akka.IO - a new set of capabilities built directly into the Akka NuGet package that allow you to communicate with your actors directly via TCP and UDP sockets from external (non-actor) systems.
๐ If you want to see a really cool example of Akka.IO in action, look at this sample that shows off how to use the Telnet commandline to interact directly with Akka.NET actors.
Akka.Persistence.MongoDb and Akka.Persistence.Sqlite ๐ Two new flavors of Akka.Persistence support are now available. You can install them via the commandline!
PM> Install-Package Akka.Persistence.MongoDb -pre
and
PM> Install-Package Akka.Persistence.Sqlite -pre
๐ Fixes & Changes - Akka.NET Core
- F# API - problem with discriminated union serialization
- Fix Null Sender issue
- ๐ฆ Outdated FsPickler version in Akka.FSharp can lead to runtime errors when other FsPickler-dependent packages are installed
- ๐ง Add default Ask timeout to HOCON configuration
- Remote watching is repeated
- RemoteDaemon bug, not removing children
- ๐ HOCON include support
- Replace SystemNanoTime with MonotonicClock
Akka.DI.StructureMap ๐ We now have support for the StructureMap dependency injection framework out of the box. You can install it here!
PM> Install-Package Akka.DI.StructureMap
-
v1.0.3 Changes
June 12, 2015๐ Bugfix release for Akka.NET v1.0.2.
๐ This release addresses an issue with Akka.Persistence.SqlServer and Akka.Persistence.PostgreSql where both packages were missing a reference to Akka.Persistence.Sql.Common.
๐ฆ In Akka.NET v1.0.3 we've packaged Akka.Persistence.Sql.Common into its own NuGet package and referenced it in the affected packages.
-
v1.0.2 Changes
June 02, 2015๐ Bugfix release for Akka.NET v1.0.1.
๐ Fixes & Changes - Akka.NET Core
- ๐ Routers seem ignore supervision strategy
- Replaced DateTime.Now with DateTime.UtcNow/MonotonicClock
- โฑ DedicatedThreadScheduler
- โฑ Add ability to specify scheduler implementation in configuration
- Added generic extensions to EventStream subscribe/unsubscribe.
- Convert null to NoSender.
- Supervisor strategy bad timeouts
- โก๏ธ Updated Pigeon.conf throughput values
- ๐ป Add PipeTo for non-generic Tasks for exception handling
๐ Fixes & Changes - Akka.NET Dependency Injection
- Added Extensions methods to ActorSystem and ActorContext to make DI more accessible
- ๐ DIActorProducer fixes
- closes akkadotnet/akka.net#1020 structuremap dependency injection
๐ Fixes & Changes - Akka.Remote and Akka.Cluster
- Fixing up cluster rejoin behavior
- ๐ Added dispatcher fixes for remote and cluster
- ๐ Fixes to ClusterRouterGroup
- ๐ Two actors are created by remote deploy using Props.WithDeploy
๐ Fixes & Changes - Akka.Persistence
- Renamed GuaranteedDelivery classes to AtLeastOnceDelivery
- Changes in Akka.Persistence SQL backend
- ๐ PostgreSQL persistence plugin for both event journal and snapshot store
- ๐ Cassandra persistence plugin
๐ New Features:
โ Akka.TestKit.XUnit2 โ Akka.NET now has support for XUnit 2.0! You can install Akka.TestKit.XUnit2 via the NuGet commandline:
PM> Install-Package Akka.TestKit.XUnit2
Akka.Persistence.PostgreSql and Akka.Persistence.Cassandra ๐ฆ Akka.Persistence now has two additional concrete implementations for PostgreSQL and Cassandra! You can install either of the packages using the following commandline:
๐ง Akka.Persistence.PostgreSql Configuration Docs
PM> Install-Package Akka.Persistence.PostgreSql
๐ง Akka.Persistence.Cassandra Configuration Docs
PM> Install-Package Akka.Persistence.Cassandra
Akka.DI.StructureMap ๐ Akka.NET's dependency injection system now supports StructureMap! You can install Akka.DI.StructureMap via the NuGet commandline:
PM> Install-Package Akka.DI.StructureMap
-
v1.0.1 Changes
April 28, 2015๐ Bugfix release for Akka.NET v1.0.
๐ Fixes:
- โฑ v1.0 F# scheduling API not sending any scheduled messages
- ๐ PinnedDispatcher - uses single thread for all actors instead of creating persanal thread for every actor
- ๐ Hotfix async await when awaiting IO completion port based tasks
- Fix for async await suspend-resume mechanics
- โฑ Nested Ask async await causes null-pointer exception in ActorTaskScheduler
- Akka.Remote: can't reply back remotely to child of Pool router
- Context.DI().ActorOf shouldn't require a parameterless constructor
- DIActorContextAdapter uses typeof().Name instead of AssemblyQualifiedName
- IndexOutOfRangeException with RoundRobinRoutingLogic & SmallestMailboxRoutingLogic
๐ New Features:
โ Akka.TestKit.NUnit โ Akka.NET now has support for NUnit inside its TestKit. You can install Akka.TestKit.NUnit via the NuGet commandline:
PM> Install-Package Akka.TestKit.NUnit
Akka.Persistence.SqlServer The first full implementation of Akka.Persistence is now available for SQL Server.
Read the full instructions for working with Akka.Persistence.SQLServer here.
-
v1.0.0 Changes
April 09, 2015Akka.NET is officially no longer in beta status. The APIs introduced in Akka.NET v1.0 will enjoy long-term support from the Akka.NET development team and all of its professional support partners.
๐ Many breaking changes were introduced between v0.8 and v1.0 in order to provide better future extensibility and flexibility for Akka.NET, and we will outline the major changes in detail in these release notes.
๐ However, if you want full API documentation we recommend going to the following:
๐ Updated Packages with 1.0 Stable Release
๐ All of the following NuGet packages have been upgraded to 1.0 for stable release:
- Akka.NET Core
- Akka.FSharp
- Akka.Remote
- โ Akka.TestKit
- Akka.DI (dependency injection)
- ๐ฒ Akka.Loggers (logging)
๐ The following packages (and modules dependent on them) are still in pre-release status:
- Akka.Cluster
- Akka.Persistence
๐ Introducing Full Mono Support for Akka.NET
๐ป One of the biggest changes in Akka.NET v1.0 is the introduction of full Mono support across all modules; we even have Raspberry PI machines talking to laptops over Akka.Remote!
โ We've tested everything using Mono v3.12.1 across OS X and Ubuntu.
Please let us know how well Akka.NET + Mono runs on your environment!
API Changes in v1.0
All methods returning an
ActorRef
now returnIActorRef
This is the most significant breaking change introduced in AKka.NET v1.0. Rather than returning theActorRef
abstract base class from all of theActorOf
,Sender
and other methods we now return an instance of theIActorRef
interface instead.๐ This was done in order to guarantee greater future extensibility without additional breaking changes, so we decided to pay off that technical debt now that we're supporting these APIs long-term.
Here's the set of breaking changes you need to be aware of:
- ๐ Renamed:
ActorRef
-->IActorRef
ActorRef.Nobody
-->ActorRefs.Nobody
ActorRef.NoSender
-->ActorRefs.NoSender
- ๐
ActorRef
's operators==
and!=
has been removed. This means all expressions likeactorRef1 == actorRef2
must be replaced withEquals(actorRef1, actorRef2)
- ๐
Tell(object message)
, i.e. the implicit sender overload, has been moved to an extension method, and requiresusing Akka.Actor;
to be accessible. - Implicit cast from
ActorRef
toRoutee
has been replaced withRoutee.FromActorRef(actorRef)
๐
async
/await
Support๐
ReceiveActor
s now support Async/Await out of the box.public class MyActor : ReceiveActor { public MyActor() { Receive<SomeMessage>(async some => { //we can now safely use await inside this receive handler await SomeAsyncIO(some.Data); Sender.Tell(new EverythingIsAllOK()); }); } }
It is also possible to specify the behavior for the async handler, using
AsyncBehavior.Suspend
andAsyncBehavior.Reentrant
as the first argument. When usingSuspend
the normal actor semantics will be preserved, the actor will not be able to process any new messages until the current async operation is completed. While usingReentrant
will allow the actor to multiplex messages during theawait
period. This does not mean that messages are processed in parallel, we still stay true to "one message at a time", but each await continuation will be piped back to the actor as a message and continue under the actors concurrency constraint.However,
PipeTo
pattern is still the preferred way to perform async operations inside an actor, as it is more explicit and clearly states what is going on.Switchable Behaviors โก๏ธ In order to make the switchable behavior APIs more understandable for both
UntypedActor
andReceiveActor
we've updated the methods to the following:Become(newHandler); // become newHandler, without adding previous behavior to the stack (default) BecomeStacked(newHandler); // become newHandler, without adding previous behavior to the stack (default) UnbecomeStacked(); //revert to the previous behavior in the stack
The underlying behavior-switching implementation hasn't changed at all - only the names of the methods.
โฑ Scheduler APIs โฑ The
Context.System.Scheduler
API has been overhauled to be both more extensible and understandable going forward. All of the previous capabilities for theScheduler
are still available, only in different packaging than they were before.Here are the new APIs:
Context.System.Scheduler .ScheduleTellOnce(TimeSpan delay, ICanTell receiver, object message, ActorRef sender); .ScheduleTellOnce(TimeSpan delay, ICanTell receiver, object message, ActorRef sender, ICancelable cancelable); .ScheduleTellRepeatedly(TimeSpan initialDelay, TimeSpan interval, ICanTell receiver, object message, ActorRef sender); .ScheduleTellRepeatedly(TimeSpan initialDelay, TimeSpan interval, ICanTell receiver, object message, ActorRef sender, ICancelable cancelable); Context.System.Scheduler.Advanced .ScheduleOnce(TimeSpan delay, Action action); .ScheduleOnce(TimeSpan delay, Action action, ICancelable cancelable); .ScheduleRepeatedly(TimeSpan initialDelay, TimeSpan interval, Action action); .ScheduleRepeatedly(TimeSpan initialDelay, TimeSpan interval, Action action, ICancelable cancelable);
โฑ There's also a set of extension methods for specifying delays and intervals in milliseconds as well as methods for all four variants (
ScheduleTellOnceCancelable
,ScheduleTellRepeatedlyCancelable
,ScheduleOnceCancelable
,ScheduleRepeatedlyCancelable
) that creates a cancelable, schedules, and returns the cancelable.๐ Akka.NET
Config
now loaded automatically from App.config and Web.config ๐ง In previous versions Akka.NET users had to do the following to load Akka.NET HOCON configuration sections from App.config or Web.config:var section = (AkkaConfigurationSection)ConfigurationManager.GetSection("akka"); var config = section.AkkaConfig; var actorSystem = ActorSystem.Create("MySystem", config);
As of Akka.NET v1.0 this is now done for you automatically:
var actorSystem = ActorSystem.Create("MySystem"); //automatically loads App/Web.config, if any
Dispatchers Akka.NET v1.0 introduces the
ForkJoinDispatcher
as well as general purpose dispatcher re-use.Using ForkJoinDispatcher ๐ง ForkJoinDispatcher is special - it uses
Helios.Concurrency.DedicatedThreadPool
to create a dedicated set of threads for the exclusive use of the actors configured to use a particularForkJoinDispatcher
instance. All of the remoting actors depend on thedefault-remote-dispatcher
for instance.Here's how you can create your own ForkJoinDispatcher instances via Config:
myapp{ my-forkjoin-dispatcher{ type = ForkJoinDispatcher throughput = 100 dedicated-thread-pool{ #settings for Helios.DedicatedThreadPool thread-count = 3 #number of threads #deadlock-timeout = 3s #optional timeout for deadlock detection threadtype = background #values can be "background" or "foreground" } } } }
๐ง You can then use this specific
ForkJoinDispatcher
instance by configuring specific actors to use it, whether it's via config or the fluent interface onProps
:Config
akka.actor.deploy{ /myActor1{ dispatcher = myapp.my-forkjoin-dispatcher } }
Props
var actor = Sys.ActorOf(Props.Create<Foo>().WithDispatcher("myapp.my-forkjoin-dispatcher"));
๐ FluentConfiguration [REMOVED] ๐ง
FluentConfig
has been removed as we've decided to standardize on HOCON configuration, but if you still want to use the old FluentConfig bits you can find them here: https://github.com/rogeralsing/Akka.FluentConfigF# API The F# API has changed to reflect the other C# interface changes, as well as unique additions specific to F#.
โก๏ธ In addition to updating the F# API, we've also fixed a long-standing bug with being able to serialize discriminated unions over the wire. This has been resolved.
Interface Renames In order to comply with .NET naming conventions and standards, all of the following interfaces have been renamed with the
I{InterfaceName}
prefix.The following interfaces have all been renamed to include the
I
prefix:- [X]
Akka.Actor.ActorRefProvider, Akka
(Public) - [X]
Akka.Actor.ActorRefScope, Akka
(Public) - [X]
Akka.Actor.AutoReceivedMessage, Akka
(Public) - [X]
Akka.Actor.Cell, Akka
(Public) - [X]
Akka.Actor.Inboxable, Akka
(Public) - [X]
Akka.Actor.IndirectActorProducer, Akka
(Public) - [X]
Akka.Actor.Internal.ChildrenContainer, Akka
(Public) - [X]
Akka.Actor.Internal.ChildStats, Akka
(Public) - โ
[X]
Akka.Actor.Internal.InternalSupportsTestFSMRef
2, Akka` (Public) - [X]
Akka.Actor.Internal.SuspendReason+WaitingForChildren, Akka
- [X]
Akka.Actor.Internals.InitializableActor, Akka
(Public) - [X]
Akka.Actor.LocalRef, Akka
- [X]
Akka.Actor.LoggingFSM, Akka
(Public) - [X]
Akka.Actor.NoSerializationVerificationNeeded, Akka
(Public) - [X]
Akka.Actor.PossiblyHarmful, Akka
(Public) - [X]
Akka.Actor.RepointableRef, Akka
(Public) - [X]
Akka.Actor.WithBoundedStash, Akka
(Public) - [X]
Akka.Actor.WithUnboundedStash, Akka
(Public) - [X]
Akka.Dispatch.BlockingMessageQueueSemantics, Akka
(Public) - [X]
Akka.Dispatch.BoundedDequeBasedMessageQueueSemantics, Akka
(Public) - [X]
Akka.Dispatch.BoundedMessageQueueSemantics, Akka
(Public) - [X]
Akka.Dispatch.DequeBasedMailbox, Akka
(Public) - [X]
Akka.Dispatch.DequeBasedMessageQueueSemantics, Akka
(Public) - [X]
Akka.Dispatch.MessageQueues.MessageQueue, Akka
(Public) - [X]
Akka.Dispatch.MultipleConsumerSemantics, Akka
(Public) - [X]
Akka.Dispatch.RequiresMessageQueue
1, Akka` (Public) - [X]
Akka.Dispatch.Semantics, Akka
(Public) - [X]
Akka.Dispatch.SysMsg.SystemMessage, Akka
(Public) - [X]
Akka.Dispatch.UnboundedDequeBasedMessageQueueSemantics, Akka
(Public) - [X]
Akka.Dispatch.UnboundedMessageQueueSemantics, Akka
(Public) - [X]
Akka.Event.LoggingAdapter, Akka
(Public) - [X]
Akka.FluentConfigInternals, Akka
(Public) - [X]
Akka.Remote.InboundMessageDispatcher, Akka.Remote
- [X]
Akka.Remote.RemoteRef, Akka.Remote
- [X]
Akka.Routing.ConsistentHashable, Akka
(Public)
ConsistentHashRouter
andIConsistentHashable
๐ง Akka.NET v1.0 introduces the idea of virtual nodes to theConsistentHashRouter
, which are designed to provide more even distributions of hash ranges across a relatively small number of routees. You can take advantage of virtual nodes via configuration:akka.actor.deployment { /router1 { router = consistent-hashing-pool nr-of-instances = 3 virtual-nodes-factor = 17 } }
Or via code:
var router4 = Sys.ActorOf(Props.Empty.WithRouter( new ConsistentHashingGroup(new[]{c},hashMapping: hashMapping) .WithVirtualNodesFactor(5)), "router4");
ConsistentHashMapping
Delegate There are three ways to instruct a router to hash a message:- Wrap the message in a
ConsistentHashableEnvelope
; - Implement the
IConsistentHashable
interface on your message types; or - Or, write a
ConsistentHashMapper
delegate and pass it to aConsistentHashingGroup
or aConsistentHashingPool
programmatically at create time.
Here's an example, taken from the
ConsistentHashSpecs
:ConsistentHashMapping hashMapping = msg => { if (msg is Msg2) { var m2 = msg as Msg2; return m2.Key; } return null; }; var router2 = Sys.ActorOf(new ConsistentHashingPool(1, null, null, null, hashMapping: hashMapping) .Props(Props.Create<Echo>()), "router2");
Alternatively, you don't have to pass the
ConsistentHashMapping
into the constructor - you can use theWithHashMapping
fluent interface built on top of bothConsistentHashingGroup
andConsistentHashingPool
:var router2 = Sys.ActorOf(new ConsistentHashingPool(1).WithHashMapping(hashMapping) .Props(Props.Create<Echo>()), "router2");
ConsistentHashable
renamed toIConsistentHashable
Any objects you may have decorated with theConsistentHashable
interface to work withConsistentHashRouter
instances will need to implementIConsistentHashable
going forward, as all interfaces have been renamed with theI-
prefix per .NET naming conventions.๐ฆ Akka.DI.Unity NuGet Package ๐ Akka.NET now ships with dependency injection support for Unity.
๐ฆ You can install our Unity package via the following command in the NuGet package manager console:
PM> Install-Package Akka.DI.Unity