Aaronontheweb on 1.4.16
Aaronontheweb on master
Added v1.4.16 placeholder for n… typo (#4734) Allow different versions of MS … and 2 more (compare)
Aaronontheweb on 1.4.16
Aaronontheweb on dev
Added v1.4.16 release notes (#4… (compare)
Aaronontheweb on 1.4.16
Added v1.4.16 release notes ##… (compare)
dependabot-preview[bot] on nuget
Bump System.Configuration.Confi… (compare)
dependabot-preview[bot] on nuget
Bump NUnit from 3.7.1 to 3.13.0… (compare)
Ok got rid of the ask pattern and instead used a message scheduler to time out. here is the new code and config on the sender side:
CODE:
//Attempt to get a list of supervisors from the SupervisorRegistry
SupervisorRegistryGetListRequest request = new SupervisorRegistryGetListRequest(Self);
_SupervisorRegistry.Tell(request);
var timeout = Context.System.Scheduler.ScheduleTellOnceCancelable(1000, Self, new SupervisorRegistryGetListEvent(request, null, false), Self);
Receive<SupervisorRegistryGetListEvent>(e => {
if(e.Success)
{
_logger.Info("{0} Received supervisor list.", Self.Path.ToStringWithAddress());
timeout.Cancel();
// Save the list for internal use
_AreaToSupervisorActor = e.ResponseGetList.SupervisorDictionary;
_logger.Debug("Actor {0} is Initialized, moving to Ready state.", _ActorType);
Become(Ready);
}
else
{
_logger.Warning("{0} Cannot retrieve list of supervisors. Unable to initialize. {1} retries.", Self.Path.ToStringWithAddress(), _FetchSupervisorListReties);
// retry the request and increase the timeout
_FetchSupervisorListReties++;
// Set up the timeout
timeout = Context.System.Scheduler.ScheduleTellOnceCancelable(1000*_FetchSupervisorListReties, Self, new SupervisorRegistryGetListEvent(request, null, false), Self);
// Send the request again
_SupervisorRegistry.Tell(request);
}
and the config on the sender side:
akka {
# here we are configuring log levels
log-config-on-start = off
stdout-loglevel = DEBUG
loglevel = DEBUG
// Define an Nlog logger for the Akka system
loggers = ["Akka.Logger.NLog.NLogLogger, Akka.Logger.NLog"]
actor {
provider = "Akka.Remote.RemoteActorRefProvider, Akka.Remote"
}
remote {
log-remote-lifecycle-events = DEBUG
log-received-messages = on
helios.tcp {
hostname = "127.0.0.1"
port = 8777
}
}
private void HandleGetListRequest(SupervisorRegistryGetListRequest r)
{
ImmutableDictionary<MicroServices.Area,IActorRef> immutableDictOfSupervisorsActors =
_KnownSupervisorsActors.ToImmutableDictionary(kvp => kvp.Key, kvp => kvp.Value.SupervisorActorReference);
Sender.Tell(new SupervisorRegistryGetListResponse(r.Requestor,immutableDictOfSupervisorsActors,r));
}
akka {
# here we are configuring log levels
log-config-on-start = off
stdout-loglevel = DEBUG
loglevel = DEBUG
// Define an Nlog logger for the Akka system
loggers = ["Akka.Logger.NLog.NLogLogger, Akka.Logger.NLog"]
// Enables connectivity to the remote ActorSystemBridge
actor {
provider = "Akka.Remote.RemoteActorRefProvider, Akka.Remote"
}
remote {
helios.tcp {
port = 8888
hostname = "127.0.0.1"
}
}
}
@Horusiath I took out the cluster
Ok got rid of the ask pattern and instead used a message scheduler to time out. here is the new code and config on the sender side:
CODE
//Attempt to get a list of supervisors from the SupervisorRegistry
SupervisorRegistryGetListRequest request = new SupervisorRegistryGetListRequest(Self);
_SupervisorRegistry.Tell(request);
var timeout = Context.System.Scheduler.ScheduleTellOnceCancelable(1000, Self, new SupervisorRegistryGetListEvent(request, null, false), Self);
Receive<SupervisorRegistryGetListEvent>(e => {
if(e.Success)
{
_logger.Info("{0} Received supervisor list.", Self.Path.ToStringWithAddress());
timeout.Cancel();
// Save the list for internal use
_AreaToSupervisorActor = e.ResponseGetList.SupervisorDictionary;
_logger.Debug("Actor {0} is Initialized, moving to Ready state.", _ActorType);
Become(Ready);
}
else
{
_logger.Warning("{0} Cannot retrieve list of supervisors. Unable to initialize. {1} retries.", Self.Path.ToStringWithAddress(), _FetchSupervisorListReties);
// retry the request and increase the timeout
_FetchSupervisorListReties++;
// Set up the timeout
timeout = Context.System.Scheduler.ScheduleTellOnceCancelable(1000*_FetchSupervisorListReties, Self, new SupervisorRegistryGetListEvent(request, null, false), Self);
// Send the request again
_SupervisorRegistry.Tell(request);
}
and the config on the sender side:
akka {
# here we are configuring log levels
log-config-on-start = off
stdout-loglevel = DEBUG
loglevel = DEBUG
// Define an Nlog logger for the Akka system
loggers = ["Akka.Logger.NLog.NLogLogger, Akka.Logger.NLog"]
actor {
provider = "Akka.Remote.RemoteActorRefProvider, Akka.Remote"
}
remote {
log-remote-lifecycle-events = DEBUG
log-received-messages = on
helios.tcp {
hostname = "127.0.0.1"
port = 8777
}
}