// After returns channel that fires with timeout
// defined in Duration method, as a special case
// if Duration is 0 returns a closed channel
488666
func (r *Linear) After() <-chan time.Time {
	if r.Duration() == 0 {
		return r.closedChan
	}
	return time.After(r.Duration())
}
1102056
func (s *Simulated) After(d time.Duration) <-chan time.Time {
	after := make(chan time.Time, 1)
	s.insert(d, func() {
		after <- (time.Time{}).Add(time.Duration(s.now))
	})
	return after
}
602150
func (date Date) After(other Date) bool {
	return date.Time.After(other.Time)
}
573670
func (f *FakeClock) After(d time.Duration) <-chan time.Time {
	f.lock.Lock()
	defer f.lock.Unlock()
	stopTime := f.time.Add(d)
	ch := make(chan time.Time, 1) // Don't block!
	f.waiters = append(f.waiters, fakeClockWaiter{
		targetTime: stopTime,
		destChan:   ch,
	})
	return ch
}
184661
func (tm *Timer) TriggerAfter(duration time.Duration) {
	go func() {
		time.Sleep(duration)
		tm.Trigger()
	}()
}
731149
func AfterFunc(d time.Duration, f func()) Timer {
	return provider.AfterFunc(d, f)
}
1090104
func ChannelAfterTouch(channel, vel int) *Event {
	return &Event{
		MsgChan:  uint8(channel),
		MsgType:  uint8(EventByteMap["ChannelAfterTouch"]),
		Pressure: uint8(vel),
	}
}
727066
func (ctx *Context) After(hook func()) {
	if ctx.Res.ended.isTrue() { // should not add afterHooks if ctx.Res.ended
		panic(Err.WithMsg(`can't add "after hook" after middleware process ended`))
	}
	ctx.Res.afterHooks = append(ctx.Res.afterHooks, hook)
}
190319
func (c *Conn) Close() error {
	c.pipe.once.Do(func() {

		// Buffered connections will attempt to wait until all
		// pending Writes are completed or until the specified
		// timeout value has elapsed.
		if c.laddr.Buffered() {

			// Set up a channel that is closed when the specified
			// timer elapses.
			timeout := c.CloseTimeout()
			timeoutDone := make(chan struct{})
			if timeout == 0 {
				close(timeoutDone)
			} else {
				time.AfterFunc(timeout, func() { close(timeoutDone) })
			}

			// Set up a channel that is closed when there is
			// no more buffered data.
			writesDone := make(chan struct{})
			go func() {
				c.buf.dataMu.Lock()
				defer c.buf.dataMu.Unlock()
				for len(c.buf.dataN) > 0 {
					c.buf.dataMu.Unlock()
					c.buf.dataMu.Lock()
				}
				close(writesDone)
			}()

			// Wait to close the connection.
			select {
			case <-writesDone:
			case <-timeoutDone:
			}
		}

		close(c.pipe.localDone)
	})
	return nil
}
1065185
func HandlerAfter(after ...HandlerResponseFunc) HandlerOption {
	return func(h *Handler) { h.after = append(h.after, after...) }
}
1138254
func (m *MockClock) AfterFunc(d time.Duration, f func()) Timer {
	t := m.NewTimer(d)
	go func() {
		<-t.Chan()
		go f()
	}()

	return t
}
1070907
func (m *Manager) afterRenew() <-chan time.Time {
	m.rw.RLock()
	exp := m.nextExpiry
	m.rw.RUnlock()

	return time.After(exp.Sub(time.Now()))
}
56467
func (c *Client) SetTimeout(t time.Duration) {
	if t <= 0 {
		c.timeout = defaultTimeout
	}
	c.timeout = t
}
343718
func (p *Plugin) AfterInit() (err error) {
	if p.disabled {
		return nil
	}

	if p.Deps.HTTP != nil {
		p.Log.Infof("exposing GRPC services via HTTP (port %v) on: /service",
			strconv.Itoa(p.Deps.HTTP.GetPort()))
		p.Deps.HTTP.RegisterHTTPHandler("/service", func(formatter *render.Render) http.HandlerFunc {
			return p.grpcServer.ServeHTTP
		}, "GET", "PUT", "POST")
	} else {
		p.Log.Infof("HTTP not set, skip exposing GRPC services")
	}

	// Start GRPC listener
	p.netListener, err = ListenAndServe(p.Config, p.grpcServer)
	if err != nil {
		return err
	}
	p.Log.Infof("Listening GRPC on: %v", p.Config.Endpoint)

	return nil
}
173406
func (p *Project) After() {
	if p.parent.After != nil {
		p.parent.After(Context{Project: p})
		return
	}
	p.cmd(nil, "after", true)
}
975413
func (c *Client) SetTimeout(duration time.Duration) {
	c.Driver.Timeout = duration
}
888696
func (engine *Engine) After(closures func(interface{})) *Session {
	session := engine.NewSession()
	session.IsAutoClose = true
	return session.After(closures)
}