MCPcopy Create free account
hub / github.com/astercloud/aster / TestActorStop

Method TestActorStop

examples/actor/actor_test.go:219–234  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

217}
218
219func (s *ActorSuite) TestActorStop() {
220 echo := &EchoActor{name: "echo"}
221 pid := s.system.Spawn(echo, "echo")
222
223 // Actor 应该存在
224 _, exists := s.system.GetActor("echo")
225 s.True(exists, "Actor 应存在")
226
227 // 停止 Actor
228 s.system.Stop(pid)
229 time.Sleep(100 * time.Millisecond)
230
231 // Actor 应该不存在
232 _, exists = s.system.GetActor("echo")
233 s.False(exists, "Actor 应已停止")
234}
235
236// =============================================================================
237// 基准测试

Callers

nothing calls this directly

Calls 3

GetActorMethod · 0.80
StopMethod · 0.65
SpawnMethod · 0.45

Tested by

no test coverage detected