Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

This repository shows usages of actor.Future.

Future.Wait/Future.Result

Future.Wait() or Future.Result() wait until the response comes or the execution times out. Since the actor blocks, incoming messages stuck in the mailbox.

Example code is located at ./wait.

Future.PipeTo

When the response comes back before Future times out, the response message is sent to the PipeTo destination. This does not block the actor so the incoming messages are executed as they come in. If the later message's execution is finished before the previous one, the response for the later message is received first as depicted in the below diagram. When the execution times out, the response is sent to dead letter mailbox and the caller actor never gets noticed.

Example code is located at ./pipe.

Context.AwaitFuture

The message execution is done in the same way as Future.PipeTo, but a callback function is called even when the execution times out.

Example code is located at ./await_future.

References

Other Example Codes

About

Some example codes to illustrate how protoactor-go handles Future process

Topics

Resources

Packages

No packages published

Languages