These are chat archives for akkadotnet/akka.net

19th
Apr 2018
Chris Hoare
@chrisjhoare
Apr 19 2018 08:16
Has anyone tried the latest Akka.FSharp release - I'm getting System.Exception : Doesn't match whenever I try to start an actor and i see the same error in some of the tests
Dave
@davenewza
Apr 19 2018 08:40
Anyone know of a resource or example to help me integrate the ASP.NET Core DI container with Akka? Looking to inject services into an actor
Ivo Grootjes
@ivog
Apr 19 2018 09:03
@chrisjhoare I'm also running into problems. Getting this exception: {System.Exception: Doesn't match
at Akka.FSharp.Linq.toExpressionActor
at Akka.FSharp.Spawn.spawnOptMessage,Returned
Chris Hoare
@chrisjhoare
Apr 19 2018 09:16
I don't think the f# tests run on the build
Ivo Grootjes
@ivog
Apr 19 2018 09:36
Akka.Fsharp project references the 1.1.0 version of FSharp.Quotations.Evaluator which is a broken package, the 1.1.2 version works correctly
Still get 2 failing tests though:
[xUnit.net 00:00:02.1871277] Starting: Akka.FSharp.Tests
[xUnit.net 00:00:03.9972422] Akka.FSharp.Tests.ApiTests.actor that accepts will receive string message [FAIL]
[xUnit.net 00:00:03.9993772] System.ArgumentException : Expression of type 'Microsoft.FSharp.Core.FSharpFunc2[Microsoft.FSharp.Core.Unit,Akka.FSharp.Actors+FunActor2[System.Object,System.Object]]' cannot be used for return type 'Akka.FSharp.Actors+FunActor2[System.Object,System.Object]' [xUnit.net 00:00:04.0018264] Stack Trace: [xUnit.net 00:00:04.0031031] at System.Linq.Expressions.Expression.ValidateLambdaArgs(Type delegateType, Expression& body, ReadOnlyCollection1 parameters)
[xUnit.net 00:00:04.0037169] at System.Linq.Expressions.Expression.Lambda(Type delegateType, Expression body, String name, Boolean tailCall, IEnumerable1 parameters) [xUnit.net 00:00:04.0040225] at System.Linq.Expressions.Expression.Lambda(Type delegateType, Expression body, IEnumerable1 parameters)
[xUnit.net 00:00:04.0041579] at Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.ConvExprToLinqInContext(ConvEnv env, FSharpExpr inp)
[xUnit.net 00:00:04.0042646] at Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.QuotationToLambdaExpressionT
[xUnit.net 00:00:04.0043729] at Akka.FSharp.Spawn.spawnOptMessage,Returned
[xUnit.net 00:00:04.0046026] at Akka.FSharp.Tests.ApiTests.actor that accepts
will receive string message()
[xUnit.net 00:00:04.0099380] Akka.FSharp.Tests.InfrastructureTests.IActorRef should be possible to use as a Key [FAIL]
[xUnit.net 00:00:04.0101755] System.ArgumentException : Expression of type 'Microsoft.FSharp.Core.FSharpFunc2[Microsoft.FSharp.Core.Unit,Akka.FSharp.Actors+FunActor2[System.Object,System.Object]]' cannot be used for return type 'Akka.FSharp.Actors+FunActor2[System.Object,System.Object]' [xUnit.net 00:00:04.0105357] Stack Trace: [xUnit.net 00:00:04.0106699] at System.Linq.Expressions.Expression.ValidateLambdaArgs(Type delegateType, Expression& body, ReadOnlyCollection1 parameters)
[xUnit.net 00:00:04.0110141] at System.Linq.Expressions.Expression.Lambda(Type delegateType, Expression body, String name, Boolean tailCall, IEnumerable1 parameters) [xUnit.net 00:00:04.0112742] at System.Linq.Expressions.Expression.Lambda(Type delegateType, Expression body, IEnumerable1 parameters)
[xUnit.net 00:00:04.0114018] at Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.ConvExprToLinqInContext(ConvEnv env, FSharpExpr inp)
[xUnit.net 00:00:04.0115228] at Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.QuotationToLambdaExpressionT
[xUnit.net 00:00:04.0116533] at Akka.FSharp.Spawn.spawnOptMessage,Returned
[xUnit.net 00:00:04.0119725] at Akka.FSharp.Tests.InfrastructureTests.IActorRef should be possible to use as a Key()
Failed Akka.FSharp.Tests.ApiTests.actor that accepts _ will receive string message
Error Message:
System.ArgumentException : Expression of type 'Microsoft.FSharp.Core.FSharpFunc2[Microsoft.FSharp.Core.Unit,Akka.FSharp.Actors+FunActor2[System.Object,System.Object]]' cannot be used for return type 'Akka.FSharp.Actors+FunActor2[System.Object,System.Object]' Stack Trace: at System.Linq.Expressions.Expression.ValidateLambdaArgs(Type delegateType, Expression& body, ReadOnlyCollection1 parameters)
at System.Linq.Expressions.Expression.Lambda(Type delegateType, Expression body, String name, Boolean tailCall, IEnumerable1 parameters) at System.Linq.Expressions.Expression.Lambda(Type delegateType, Expression body, IEnumerable1 parameters)
at Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.ConvExprToLinqInContext(ConvEnv env, FSharpExpr inp)
at Microsoft.FSharp.Linq.RuntimeHelp
Bartosz Sypytkowski
@Horusiath
Apr 19 2018 09:43
@ivog can you set an issue on github?
@davenewza maybe I'm wrong, but it doesn't seem to be the best idea, unless all your injected services are singletons - otherwise, you can end up creating actors inside asp.net controller which will live longer than that controller. If injected service lifetime is bound to controller lifetime, service can be killed while actor using it will still operate.
Ivo Grootjes
@ivog
Apr 19 2018 10:06
@Horusiath i created 2 issues #3402 and #3403
Marin
@mrn-aglic
Apr 19 2018 10:19
Hi, I'm trying to use Akka.Remote, I've copied the configuration from the page https://getakka.net/articles/concepts/configuration.html .... but whenever I try to create an ActorSystem I get the following exception: TypeLoadException: Cannot instantiate transport [Akka.Remote.Transport.DotNetty.DotNettyTransport, Akka.Remote]. It has no public constructor with [Akka.Actor.ActorSystem] and [Akka.Configuration.Config] parameters
Dave
@davenewza
Apr 19 2018 10:27
@Horusiath That's an interesting point... I have no idea how DI scoping would handle this. In this case I want to inject a service into an actor (for example, a repository) - how would one typically do something like this then? I am actually looking at sending a message to all clients registered on a SignalR hub, which means I need to inject the HubContext into the actor
Chris Hoare
@chrisjhoare
Apr 19 2018 10:47
i found that changing the static extension method on Expression line 384 in FsApi.fs to just return the f being passed in fixed those failing tests - but I'm not really sure about the context of this
Ivo Grootjes
@ivog
Apr 19 2018 11:00
@chrisjhoare can you maybe add this info to #3403
Chris Hoare
@chrisjhoare
Apr 19 2018 11:02
will do
Marin
@mrn-aglic
Apr 19 2018 13:28
I think that there is a missing bracket in the configuration example: https://getakka.net/articles/concepts/configuration.html (HOCON example)
me-slove
@me-slove
Apr 19 2018 16:17
Does an ActorSystem need to be in a Process or can a console app create tasks that create ActorSystems?
Aaron Stannard
@Aaronontheweb
Apr 19 2018 16:18
@mrn-aglic where at?
@me-slove it can run inside a console app
me-slove
@me-slove
Apr 19 2018 16:19
Aaron my question was of having a console spawn many
We want to be able to create nodes within a VM based upon pressure. Kinda similar to a threadpool. Maybe there is another way?
Joshua Garnett
@joshgarnett
Apr 19 2018 16:22
What’s the benefit of spawning new nodes within the same VM?
Seems like that would just cause more contention for resources
vs letting akka handle scheduling in a single process accordingly
me-slove
@me-slove
Apr 19 2018 16:23
Nodes can be clustered and shared into a routing group
In this case, they are utility actors that are essentially background workers
might be as simple as a pool router but wondered about other alternatives
Patrick Kelly
@featuresnap
Apr 19 2018 18:01
@spankr @Aaronontheweb you discussed a change to how TestProbes are created (under /system instead of /user) a while back that broke some tests for actors that rely on ActorSelection. Any idea what the best way to address this is? We're using the ActorPaths and ActorMetadata helper classes to look up the path for use in an ActorSelection. Given the reason for this change (shut down User actors before Test actors), it seems that any approach trying to put the test actors under the /user node would be philosophically wrong. Thinking of modifying the ActorMetadata class to allow overriding/injecting the path returned during a test run... any other ideas?