MCPcopy Create free account
hub / github.com/DNAProject/DNA / startActor

Function startActor

txnpool/server.go:39–51  ·  view source on GitHub ↗

startActor starts an actor with the proxy and unique id, and return the pid.

(obj interface{}, id string)

Source from the content-addressed store, hash-verified

37// startActor starts an actor with the proxy and unique id,
38// and return the pid.
39func startActor(obj interface{}, id string) (*actor.PID, error) {
40 props := actor.FromProducer(func() actor.Actor {
41 return obj.(actor.Actor)
42 })
43 props.WithMailbox(mailbox.BoundedDropping(tc.MAX_LIMITATION))
44
45 pid, _ := actor.SpawnNamed(props, id)
46 if pid == nil {
47 return nil, fmt.Errorf("fail to start actor at props:%v id:%s",
48 props, id)
49 }
50 return pid, nil
51}
52
53// StartTxnPoolServer starts the txnpool server and registers
54// actors to handle the msgs from the network, http, consensus

Callers 1

StartTxnPoolServerFunction · 0.70

Calls 1

ErrorfMethod · 0.80

Tested by

no test coverage detected