startActor starts an actor with the proxy and unique id, and return the pid.
(obj interface{}, id string)
| 37 | // startActor starts an actor with the proxy and unique id, |
| 38 | // and return the pid. |
| 39 | func 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 |
no test coverage detected