Commit Graph

2 Commits

Author SHA1 Message Date
Ryan Nowak 3a03ada243
Use Startup to register Actors (#533)
Fixes: #434

This change introduces new APIs for registering Actors DI and with
the HTTP pipeline based on the ASP.NET Core Startup.cs model. This
replaces `UseActors()` in Program.cs and delivers better integration
between the ASP.NET Core framework and Actors.

The bug that motivated this change was that the actors HTTP handlers
were separate from the application's main routing table. This meant that
certain routing patterns were totally broken (such as Blazor Server)
when used in the same project as actors. There was no real way to fix
this without a change in how we register the framework to make it more
consistent with other features that build on ASP.NET Core.
2021-01-08 11:30:07 -08:00
Ryan Nowak e95a5567f2
Implement dependency injection for Actors (#463)
* Implement dependency injection for Actors

Fixes: #171

This change allows Actors to accept dependency-injected services through
constructor parameters.

There are numerous breaking changes in this PR that are visible to user
code. In most cases these are simplifications.

For example the Actor base class accepted 3 constructor parameters,
which meant that every subclass (every actor type) also had 3 constructor
parameters. This isn't fun and becomes way less fun now that users can
add their own constructor parameters in a meaningful way.

As another example, we had multiple places where "runtime options" lived
that had different interaction patterns. Now there's a single options
type and you interactive with it through UseActors(...).

* address PR feedback

* React to API change
2020-12-01 10:15:08 -08:00