mirror of
https://github.com/storytold/EventCenterPlugin.git
synced 2026-10-09 00:09:42 +00:00
new pattern for handling the redis results
This commit is contained in:
@@ -0,0 +1,16 @@
|
|||||||
|
#include "ProtocolLibrary.h"
|
||||||
|
|
||||||
|
FTtsRequest UProtocolLibrary::DecodeTtsPayload(const FString& payload)
|
||||||
|
{
|
||||||
|
FTtsRequest request = FTtsRequest();
|
||||||
|
|
||||||
|
request.Username = FString(TEXT("user"));
|
||||||
|
request.VoiceName = FString(TEXT("sonic"));
|
||||||
|
request.Text = FString(TEXT("gotta go fast"));
|
||||||
|
|
||||||
|
return request;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*void UProtocolLibrary::DecodeTtsPayload()
|
||||||
|
{
|
||||||
|
}*/
|
||||||
@@ -22,6 +22,7 @@ DECLARE_LOG_CATEGORY_EXTERN(EventSourceLog, Log, All);
|
|||||||
// due to an Unreal Engine limitation
|
// due to an Unreal Engine limitation
|
||||||
DECLARE_DYNAMIC_DELEGATE_TwoParams(FMySubscriberRefDelegate, const FString&, Channel, const FString&, Message);
|
DECLARE_DYNAMIC_DELEGATE_TwoParams(FMySubscriberRefDelegate, const FString&, Channel, const FString&, Message);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AEventSourceActor
|
* AEventSourceActor
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
// Unreal Core
|
||||||
|
#include "CoreMinimal.h"
|
||||||
|
#include "UObject/NoExportTypes.h"
|
||||||
|
|
||||||
|
#include "Kismet/BlueprintFunctionLibrary.h"
|
||||||
|
|
||||||
|
#include "ProtocolTypes.h"
|
||||||
|
|
||||||
|
#include "ProtocolLibrary.generated.h"
|
||||||
|
|
||||||
|
UCLASS()
|
||||||
|
class EVENTCENTERPLUGIN_API UProtocolLibrary : public UBlueprintFunctionLibrary
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
public:
|
||||||
|
UFUNCTION(BlueprintPure, Category = "EventCenterHelperFunctions")
|
||||||
|
static FTtsRequest DecodeTtsPayload(const FString& payload);
|
||||||
|
};
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
// Unreal Core
|
||||||
|
#include "CoreMinimal.h"
|
||||||
|
#include "UObject/NoExportTypes.h"
|
||||||
|
|
||||||
|
#include "ProtocolTypes.generated.h"
|
||||||
|
|
||||||
|
/*UCLASS()
|
||||||
|
class EVENTCENTERPLUGIN_API UTtsRequest : public UObject {
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
public:
|
||||||
|
inline UTtsRequest() {
|
||||||
|
}
|
||||||
|
|
||||||
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
|
||||||
|
FString Username;
|
||||||
|
|
||||||
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
|
||||||
|
FString VoiceName;
|
||||||
|
|
||||||
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
|
||||||
|
FString Text;
|
||||||
|
};*/
|
||||||
|
|
||||||
|
USTRUCT(BlueprintType)
|
||||||
|
struct EVENTCENTERPLUGIN_API FTtsRequest {
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
public:
|
||||||
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
|
||||||
|
FString Username;
|
||||||
|
|
||||||
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
|
||||||
|
FString VoiceName;
|
||||||
|
|
||||||
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
|
||||||
|
FString Text;
|
||||||
|
};
|
||||||
|
|
||||||
@@ -28,7 +28,9 @@ async def server(websocket, path):
|
|||||||
|
|
||||||
mpsc = Receiver(loop=loop)
|
mpsc = Receiver(loop=loop)
|
||||||
async def reader(mpsc):
|
async def reader(mpsc):
|
||||||
|
print('foo', flush=True)
|
||||||
async for channel, msg in mpsc.iter():
|
async for channel, msg in mpsc.iter():
|
||||||
|
print('bar', flush=True)
|
||||||
assert isinstance(channel, AbcChannel)
|
assert isinstance(channel, AbcChannel)
|
||||||
print("Got {!r} in channel {!r}".format(msg, channel))
|
print("Got {!r} in channel {!r}".format(msg, channel))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user