// SignalInfo returns the SignalInfo that is correlates with a given event. The HistoryEvent is expected to be of type EventTypeSignalExternalWorkflowExecutionFailed,EventTypeExternalWorkflowExecutionSignaled.
340717
func (a *EventCorrelator) SignalInfo(h *swf.HistoryEvent) *SignalInfo {
	a.checkInit()
	return a.Signals[a.getId(h)]
}
1333314
func (a *Application) ServiceInfo() (CloudService, error) {
	svc, err := a.st.CloudService(a.Name())
	if err != nil {
		return CloudService{}, errors.Trace(err)
	}
	return *svc, nil
}
1056565
func (s *Instance) Notify(sig os.Signal) {
	glog.V(1).Infof("Notify: sending signal %v", sig)
	select {
	case s.signalChan <- sig:
		glog.V(1).Infof("Notify: sent signal %v", sig)
	default:
		// This may happen if we're trying to kill a process that has already died. The controller will first send
		// SIGTERM, then it will try SIGKILL
		glog.Warningf("Notify: unable to send signal %v because channel is full", sig)
	}
}
774485
func (s *Server) traceInfo(st transport.ServerTransport, stream *transport.Stream) (trInfo *traceInfo) {
	tr, ok := trace.FromContext(stream.Context())
	if !ok {
		return nil
	}

	trInfo = &traceInfo{
		tr: tr,
		firstLine: firstLine{
			client:     false,
			remoteAddr: st.RemoteAddr(),
		},
	}
	if dl, ok := stream.Context().Deadline(); ok {
		trInfo.firstLine.deadline = time.Until(dl)
	}
	return trInfo
}
513081
func NewStatusInfo(s status.StatusInfo, err error) StatusInfo {
	return StatusInfo{
		Err:     err,
		Current: s.Status,
		Message: s.Message,
		Since:   s.Since,
		Data:    s.Data,
	}
}
244643
func Info(msg string, fields map[string]interface{}) error {
	return defaultLogger.Log(LvInfo, msg, fields)
}
730678
func Info(ctx context.Context, msg string, logCtx ...interface{}) {
	FromContext(ctx).Info(msg, logCtx...)
}
841039
func (c *Consumer) Info(msg string) {
	if c != nil && c.OnMessage != nil {
		c.OnMessage("info", msg)
	}
}
705858
func (e *Engine) Info(ctx context.Context) (*enginetypes.Info, error) {
	infoCtx, cancel := context.WithTimeout(ctx, 2*time.Second)
	defer cancel()
	r, err := e.client.Info(infoCtx)
	if err != nil {
		return nil, err
	}
	return &enginetypes.Info{ID: r.ID, NCPU: r.NCPU, MemTotal: r.MemTotal}, nil
}
690515
func (l *Logger) Info(v interface{}) {
	if l.checkLogLevel(InfoLevel) {
		l.Output(time.Now(), InfoLevel, format(v))
	}
}
347762
func signalName(s syscall.Signal) string {
	if name, ok := signalNames[s]; ok {
		return name
	}
	return fmt.Sprintf("SIG %d", s)
}
1229945
func Info(v ...interface{}) {
	std.Fprint(std.flags, LEVEL_INFO, 2, fmt.Sprint(v...), nil)
}
862776
func (c *CmdWatchdog2) Infof(s string, args ...interface{}) {
	c.G().Log.Info(s, args...)
}
74336
func (c *HyperClient) Info() (*types.InfoResponse, error) {
	info, err := c.client.Info(
		c.ctx,
		&types.InfoRequest{},
	)

	if err != nil {
		return nil, err
	}

	return info, nil
}
1338604
func (c *asyncClient) Info() (result FutureInfo, err Error) {
	var resp *PendingResponse
	resp, err = c.conn.QueueRequest(&INFO, [][]byte{})
	if err == nil {
		result = newFutureInfo(resp.future.(FutureBytes))
	}
	return result, err
}
887085
func OnSignalSent(signalName string, deciders ...Decider) Decider {
	return func(ctx *FSMContext, h *swf.HistoryEvent, data interface{}) Outcome {
		switch *h.EventType {
		case swf.EventTypeExternalWorkflowExecutionSignaled:
			// if we find a good signal info with matching signal, we have matched workflowId and signalId so fire deciders.
			info := ctx.SignalInfo(h)
			if info != nil && info.SignalName == signalName {
				logf(ctx, "at=on-signal-sent")
				return NewComposedDecider(deciders...)(ctx, h, data)
			}
		}
		return ctx.Pass()
	}
}
321025
func SignalWith(handler Handler, sigchan <-chan os.Signal) <-chan os.Signal {
	output := make(chan os.Signal)

	// We capture the stack frame here instead of in the goroutine because it
	// gives a more meaningful value (the caller of Signal, which usually is
	// the application itself).
	var pc [1]uintptr
	runtime.Callers(2, pc[:])
	file, line := SourceForPC(pc[0])

	go func() {
		defer close(output)

		for sig := range sigchan {
			handler.HandleEvent(&Event{
				Message: sig.String(),
				Source:  fmt.Sprintf("%s:%d", file, line),
				Time:    time.Now(),
				Args:    Args{{"signal", sig}},
			})
			// Limits to 1s the attempt to publish to the output channel, this
			// is a safeguard for programs that don't consume from the output
			// channel (event though they should).
			select {
			case output <- sig:
			case <-time.After(time.Second):
			}
		}
	}()

	return output
}