mirror of
https://github.com/storytold/EventCenterPlugin.git
synced 2026-11-21 09:30:47 +01:00
Callback to spawn actors from Redis event dispatcher WORKS!!!
This commit is contained in:
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);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user