Skip to content

Commit

Permalink
Complete the sender field of deadletters object. asynkron#60
Browse files Browse the repository at this point in the history
  • Loading branch information
guoxilin committed Jan 5, 2017
1 parent 25742be commit f2bba42
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions actor/deadletter.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ var (
type DeadLetter struct {
PID *PID
Message interface{}
Sender *PID
}

func (*DeadLetterActorRef) SendUserMessage(pid *PID, message interface{}, sender *PID) {
EventStream.Publish(&DeadLetter{
PID: pid,
Message: message,
Sender: sender,
})
}

Expand Down
2 changes: 1 addition & 1 deletion actor/event_stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type Subscription struct {
func init() {
EventStream.Subscribe(func(msg interface{}) {
if deadLetter, ok := msg.(*DeadLetter); ok {
log.Printf("[DeadLetter] %v got %+v", deadLetter.PID, deadLetter.Message)
log.Printf("[DeadLetter] %v got %+v from %v", deadLetter.PID, deadLetter.Message, deadLetter.Sender)
}
})
}
Expand Down

0 comments on commit f2bba42

Please sign in to comment.