// FakeAfterFunc waits for the duration to elapse and then executes a function.
// A Timer is returned that can be stopped.
543101
func (fc *FakeClock) FakeAfterFunc(d time.Duration, f func()) *FakeTimer {
	t := fc.FakeTimer(d)
	go func() {
		<-t.c
		f()
	}()
	nap()
	return t
}
786998
func BackoffExponential(scalar time.Duration) BackoffFunc {
	return func(attempt uint) time.Duration {
		return scalar * time.Duration(backoffutils.ExponentBase2(attempt))
	}
}
1317375
func (l *Loader) RunAfterLoad(fn func(*Wallet)) {
	l.mu.Lock()
	if l.wallet != nil {
		w := l.wallet
		l.mu.Unlock()
		fn(w)
	} else {
		l.callbacks = append(l.callbacks, fn)
		l.mu.Unlock()
	}
}
55099
func (fc *FakeClock) FakeTimer(d time.Duration) *FakeTimer {
	fc.Lock()
	defer fc.Unlock()

	c := make(chan time.Time, 1)
	t := &FakeTimer{
		c:     c,
		clock: fc,
		time:  fc.now.Add(d),
	}
	fc.addTimer(t)
	return t
}
275295
func (h *Handler) WaitForReady() bool {
	// there is no ready func configured, so we return immediately
	if h.readyFunc == nil {
		return true
	}

	timeout := time.After(timeToWaitForReady)
	for !h.readyFunc() {
		select {
		case <-time.After(100 * time.Millisecond):
		case <-timeout:
			return h.readyFunc()
		}
	}
	return true
}
684876
func (s *stopChan) StopFunc(perform func()) {
	s.StopErrFunc(func() error {
		if perform != nil {
			perform()
		}
		return nil
	})
}
26142
func (s *SetReceiptRulePositionInput) SetAfter(v string) *SetReceiptRulePositionInput {
	s.After = &v
	return s
}
461762
func (a *Application) SetAfterDrawFunc(handler func(screen tcell.Screen)) *Application {
	a.afterDraw = handler
	return a
}
1151861
func (s *DescribeCasesInput) SetAfterTime(v string) *DescribeCasesInput {
	s.AfterTime = &v
	return s
}
362744
func (s *ListCodeRepositoriesInput) SetCreationTimeAfter(v time.Time) *ListCodeRepositoriesInput {
	s.CreationTimeAfter = &v
	return s
}
1133801
func (t *Module) SetAfter(action cli.ActionFunc) *Module {
	t.After = action
	return t
}
327280
func (m *Mock) AfterFunc(d time.Duration, f func()) *Timer {
	t := m.Timer(d)
	go func() {
		<-t.c
		f()
	}()
	nap()
	return t
}
400660
func (m *MockClock) After(d time.Duration) <-chan time.Time {
	ch := make(chan time.Time, 1)
	target := m.Now().Add(d)

	go func() {
		for {
			m.cond.L.Lock()
			if !target.After(m.now) {
				now := m.now
				m.cond.L.Unlock()
				ch <- now
				return
			}

			m.cond.Wait()
			m.cond.L.Unlock()
		}
	}()

	return ch
}
1065185
func HandlerAfter(after ...HandlerResponseFunc) HandlerOption {
	return func(h *Handler) { h.after = append(h.after, after...) }
}
1257271
func synchronousFunc(c *asticontext.Canceller, l listenable, fn func(), eventNameDone string) (e Event) {
	var ctx, cancel = c.NewContext()
	defer cancel()
	l.On(eventNameDone, func(i Event) (deleteListener bool) {
		e = i
		cancel()
		return true
	})
	fn()
	<-ctx.Done()
	return
}
184661
func (tm *Timer) TriggerAfter(duration time.Duration) {
	go func() {
		time.Sleep(duration)
		tm.Trigger()
	}()
}
1138471
func WaitFunc(wg *sync.WaitGroup, wait func()) StopChan {
	return WaitErrFunc(wg, func() error {
		wait()
		return nil
	})
}