Exemplo n.º 1
0
// Forward implements Resolver.Forward().
func (s *turnResolver) Forward(n async.ResultT) {
	assert.True(!s.isResolved(), "Cannot forward an already completed result.")

	next := async.InternalUseOnlyGetResolver(n).(*turnResolver)
	assert.True(next.manager == s.manager, "Cannot forward across managers.")

	next = next.getShortest()
	turns := s.turns
	s.turns, s.outcome, s.next = nil, nil, next
	next.queueList(turns)
}
Exemplo n.º 2
0
func (t *TurnRunnerCoreSuite) Done() {
	log.Infof("Running test %s", base.GetMethodName())
	manager := NewManager(NewUniqueIDGenerator())
	runner := NewTurnRunner(manager)
	tlsRelease := async.SetAmbientRunner(runner)
	defer tlsRelease()

	done := async.Done()
	s := async.InternalUseOnlyGetResolver(done.ResultT).(*turnResolver)
	if !s.isResolved() {
		t.Errorf("Expected Done() to be resolved.  Got: %v, Want: resolved", done)
	}
}