<commit_before>package remoting

import (
	"log"

	"github.com/AsynkronIT/gam/actor"
	"github.com/gogo/protobuf/proto"
)

type remoteActorRef struct {
	pid *actor.PID
	actor.ActorRef
}

func newRemoteActorRef(pid *actor.PID) actor.ActorRef {
	return &remoteActorRef{
		pid: pid,
	}
}

func (ref *remoteActorRef) Tell(pid *actor.PID, message interface{}) {
	ref.send(pid, message, nil)
}

func (ref *remoteActorRef) Ask(pid *actor.PID, message interface{}, sender *actor.PID) {
	ref.send(pid, message, sender)
}

func (ref *remoteActorRef) send(pid *actor.PID, message interface{}, sender *actor.PID) {
	switch msg := message.(type) {
	case proto.Message:
		envelope, _ := packMessage(msg, ref.pid, sender)
		endpointManagerPID.Tell(envelope)<commit_msg>remote system messages<commit_after>package remoting

import (
	"log"

	"github.com/AsynkronIT/gam/actor"
	"github.com/gogo/protobuf/proto"
)

type remoteActorRef struct {
	pid *actor.PID
}

func newRemoteActorRef(pid *actor.PID) actor.ActorRef {
	return &remoteActorRef{
		pid: pid,
	}
}

func (ref *remoteActorRef) Tell(pid *actor.PID, message interface{}) {
	ref.send(pid, message, nil)
}

func (ref *remoteActorRef) Ask(pid *actor.PID, message interface{}, sender *actor.PID) {
	ref.send(pid, message, sender)
}

func (ref *remoteActorRef) send(pid *actor.PID, message interface{}, sender *actor.PID) {
	switch msg := message.(type) {
	case proto.Message:
		envelope, _ := packMessage(msg, ref.pid, sender)
		endpointManagerPID.Tell(envelope)
{'fraction_non_alphanumeric': 0.14076050700466977, 'fraction_numerical': 0.0, 'mean_word_length': 5.097560975609756, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6059427', 'n_tokens_mistral': 555, 'n_tokens_neox': 529, 'n_words': 122}