// SendEvent command
543280
func (self *FSock) SendEvent(eventSubclass string, eventParams map[string]string) (string, error) {
	return self.SendEventWithBody(eventSubclass, eventParams, "")
}
560627
func (whisper *Whisper) postEvent(envelope *Envelope, isP2P bool) {
	if isP2P {
		whisper.p2pMsgQueue <- envelope
	} else {
		whisper.checkOverflow()
		whisper.messageQueue <- envelope
	}
}
735602
func (st *S2S) Send(event map[string]string) (int64, error) {
	return st.Copy(bytes.NewBuffer(EncodeEvent(event)))
}
652462
func (srv *Instance) PublishEvent(e lifecycle.Event) error {
	return lifecycle.PublishEvent(e, srv.connector)
}
302052
func (target *PeerRESTClientTarget) send(eventData event.Event) error {
	return target.restClient.SendEvent(target.bucketName, target.id, target.remoteTargetID, eventData)
}
259305
func NewEvent(event interface{}, sourceURL string) *Event {
	return &Event{
		SourceURL: sourceURL,
		Event:     event,
	}
}
1286296
func (m *EventHandler) HandleEvent(ctx context.Context, event eh.Event) error {
	if m.Err != nil {
		return m.Err
	}
	m.Events = append(m.Events, event)
	m.Context = ctx
	m.Time = time.Now()
	m.Recv <- event
	return nil
}
996676
func sendEvent(ev event.Event) {
	if ev.SampleRate == -1 {
		// drop the event!
		logrus.WithFields(logrus.Fields{
			"event": ev,
		}).Debug("droppped event due to sampling")
		return
	}
	libhEv := libhoney.NewEvent()
	libhEv.Metadata = ev
	libhEv.Timestamp = ev.Timestamp
	libhEv.SampleRate = uint(ev.SampleRate)
	if err := libhEv.Add(ev.Data); err != nil {
		logrus.WithFields(logrus.Fields{
			"event": ev,
			"error": err,
		}).Error("Unexpected error adding data to libhoney event")
	}
	if err := libhEv.SendPresampled(); err != nil {
		logrus.WithFields(logrus.Fields{
			"event": ev,
			"error": err,
		}).Error("Unexpected error event to libhoney send")
	}
}
789825
func (l *Logger) HandleEvent(ctx context.Context, event eh.Event) error {
	log.Println("event:", event)
	return nil
}
570470
func SendHostEvent(title string, text string, sev severity, duration time.Duration) {
	sendEvent(&EventData{
		Title:    title,
		Text:     text,
		Duration: int(duration / time.Millisecond),
		Severity: int(sev),
	})
}
966644
func sendEvents(evtChan chan *dt.ScheduledEvent, interval time.Duration) {
	t := time.NewTicker(time.Minute)
	select {
	case now := <-t.C:
		sendEventsTick(evtChan, now)
		sendEvents(evtChan, interval)
	}
}
1155177
func (s *TestEventPatternInput) SetEvent(v string) *TestEventPatternInput {
	s.Event = &v
	return s
}
934983
func EventsCommand(factory app.ProjectFactory) cli.Command {
	return cli.Command{
		Name:   "events",
		Usage:  "Receive real time events from containers.",
		Action: app.WithProject(factory, app.ProjectEvents),
		Flags: []cli.Flag{
			cli.BoolFlag{
				Name:  "json",
				Usage: "Output events as a stream of json objects",
			},
		},
	}
}
315537
func (f EventHandlerFunc) HandleEvent(resp http.ResponseWriter, req *http.Request, event *Event) {
	f(resp, req, event)
}
1099567
func SendEvents(c Client, e *[]Event) (*proto.Msg, error) {
	buff := make(
		[]*proto.Event, len(*e),
	)

	for i, elem := range *e {
		epb, err := EventToProtocolBuffer(
			&elem,
		)

		if err != nil {
			return nil, err
		}

		buff[i] = epb
	}

	message := new(proto.Msg)
	message.Events = buff

	return c.Send(message)
}
7559
func (s *UnsubscribeFromEventInput) SetEvent(v string) *UnsubscribeFromEventInput {
	s.Event = &v
	return s
}
622207
func (e *Elector) sendEvent(event Event) {
	select {
	case e.events <- event:
	case <-e.closing:
		select {
		case e.events <- event:
		default:
			// drop outgoing events if close was called and there is no
			// longer a listener awaiting events.
		}
	}
}