Is it possible to create an Asynchronous BlueprintCallable UFUNCTION?
Where the control output is only activated after some asynchronous processing.
Similar to K2Node_InAppPurchase, but without creating a new K2Node class?
Is it possible to create an Asynchronous BlueprintCallable UFUNCTION?
Where the control output is only activated after some asynchronous processing.
Similar to K2Node_InAppPurchase, but without creating a new K2Node class?
You can create a thread to do some processing and when that processing is complete, you can notify the main thread that it needs to fire an event. but you cannot fire an event from anything but the main thread.
What I’m asking is how should this be declared in the blueprint library
If I just declare:
UFUNCTION(BlueprintCallable, Category = "Online.Hello.hello")
static void SendHello(FString Message);
The control output of the block created will be activated immediately.
How do I declare this in a way that Unreal knows that this is asynchronous?
I’d guess it would look something like:
// wrong code, just a wild guess.
UFUNCTION(BlueprintCallable, Category = "Online.Hello.hello")
static TFuture<FString> SendHello(FString Message);
Found it. In unreal engine async functions are called “latent functions”. And you define them like:
UFUNCTION(BlueprintCallable, Category = "Online|Hello|hello", meta = (Latent, LatentInfo = "LatentInfo", Duration = "0.2"))
static void Hello(FString Message, struct FLatentActionInfo LatentInfo);
Searching for this in the docs gives more information.
A good example is the Delay function from the kismet system library.
Hi Daniel, looks its hard to find this in docs? Could you point me to some docs? Thanks!