Callback to spawn actors from Redis event dispatcher WORKS!!!

This commit is contained in:
Brandon Thomas committed 2021-02-17 06:27:18 -05:00
1 parent 74b73aad49
commit b8d826f080
4 files changed
+24 -4

No files matched your search

@@ -97,8 +97,7 @@ void AEventSourceActor::Subscribe(const FString& Channel)
if (!redis->SubscribeReply.IsBound()) {
UE_LOG(EventSourceLog, Log, TEXT("Subscribe(): binding event"));
//redis->SubscribeReply.AddDynamic(this, "AEventSourceActor::SubscribeCallback(FString Channel, FString Message)");
redis->SubscribeReply.AddDynamic(this, &AEventSourceActor::SubscribeCallback);
redis->SubscribeReply.AddDynamic(this, &AEventSourceActor::InternalSubscribeCallback);
}
}
@@ -113,9 +112,14 @@ void AEventSourceActor::Unsubscribe(const FString& Channel)
redis->Unsubscribe(Channel);
}
void AEventSourceActor::SubscribeCallback(FString Channel, FString Message)
void AEventSourceActor::InternalSubscribeCallback(FString Channel, FString Message)
{
//UE_LOG(EventSourceLog, Log, TEXT("SubscribeCallback(): %s %s"), Channel, Message);
UE_LOG(EventSourceLog, Log, TEXT("SubscribeCallback(): called"));
if (MyDelegate.IsBound()) {
MyDelegate.Broadcast(Channel, Message);
}
}