// DelEvent 删除事件
542501
func (s *Application) DelEvent(eventName string) *Application {
	events.DelEvent(eventName)
	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.
		}
	}
}
10420
func BeginEvent(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "beginEvent", Listener: listener}
}
201665
func (a *Application) QueueEvent(event tcell.Event) *Application {
	a.events <- event
	return a
}
645372
func (h EventHandlerFunc) HandleEvent(ctx context.Context, e Event) error {
	return h(ctx, e)
}
311521
func (s *AssessmentRunNotification) SetEvent(v string) *AssessmentRunNotification {
	s.Event = &v
	return s
}
1196854
func (watcher *RecursiveWatcher) handleEvent(event *fsnotify.FileEvent) {
	if event.IsCreate() {
		watcher.handleCreate(event)
	}

	e := Event{
		FileEvent: event,
	}

	watcher.Events <- e
}
624700
func NewEvent(name string, data interface{}) *Event {
	return &Event{Name: name, Data: data}
}
759343
func NewEvent(category string, action string) *Event {
	h := &Event{
		category: category,
		action:   action,
	}
	return h
}
751534
func ControlEvent(v interface{}) *Event {
	event := NewEvent(v)
	event.Control = true
	return event
}
543280
func (self *FSock) SendEvent(eventSubclass string, eventParams map[string]string) (string, error) {
	return self.SendEventWithBody(eventSubclass, eventParams, "")
}
1083127
func (d *eventDispatcher) DispatchEvent(e Event) {
	d.RLock()
	defer d.RUnlock()

	// Automatically set the event source.
	if e, ok := e.(*event); ok {
		e.source = d.source
	}

	// Dispatch the event to all listeners.
	for _, l := range d.listeners[e.Type()] {
		l(e)
	}
}
315537
func (f EventHandlerFunc) HandleEvent(resp http.ResponseWriter, req *http.Request, event *Event) {
	f(resp, req, event)
}
34620
func addEvent(conn redis.Conn, e contract.Event) (id string, err error) {
	if e.Created == 0 {
		e.Created = db.MakeTimestamp()
	}

	if e.ID == "" {
		e.ID = uuid.New().String()
	}

	m, err := marshalEvent(e)
	if err != nil {
		return "", err
	}

	_ = conn.Send("MULTI")
	_ = conn.Send("SET", e.ID, m)
	_ = conn.Send("ZADD", db.EventsCollection, 0, e.ID)
	_ = conn.Send("ZADD", db.EventsCollection+":created", e.Created, e.ID)
	_ = conn.Send("ZADD", db.EventsCollection+":pushed", e.Pushed, e.ID)
	_ = conn.Send("ZADD", db.EventsCollection+":device:"+e.Device, e.Created, e.ID)

	rids := make([]interface{}, len(e.Readings)*2+1)
	rids[0] = db.EventsCollection + ":readings:" + e.ID
	for i, r := range e.Readings {
		r.Created = e.Created
		r.Device = e.Device

		if r.Id != "" {
			_, err = uuid.Parse(r.Id)
			if err != nil {
				return "", db.ErrInvalidObjectId
			}
		}
		id, err = addReading(conn, false, r)
		if err != nil {
			return id, err
		}
		rids[i*2+1] = 0
		rids[i*2+2] = id
	}
	if len(rids) > 1 {
		_ = conn.Send("ZADD", rids...)
	}

	_, err = conn.Do("EXEC")
	return e.ID, err
}
73523
func (c *Client) SimpleEvent(title, text string) error {
	e := NewEvent(title, text)
	return c.Event(e)
}
82024
func (mc MongoClient) AddEvent(e contract.Event) (string, error) {
	s := mc.getSessionCopy()
	defer s.Close()

	//Add the readings
	if len(e.Readings) > 0 {
		var ui []interface{}
		for i, reading := range e.Readings {
			var r models.Reading
			id, err := r.FromContract(reading)
			if err != nil {
				return "", err
			}

			r.TimestampForAdd()

			ui = append(ui, r)

			e.Readings[i].Id = id
		}
		if err := s.DB(mc.database.Name).C(db.ReadingsCollection).Insert(ui...); err != nil {
			return "", errorMap(err)
		}
	}

	var mapped models.Event
	id, err := mapped.FromContract(e, mc)
	if err != nil {
		return "", err
	}

	mapped.TimestampForAdd()

	if err = s.DB(mc.database.Name).C(db.EventsCollection).Insert(mapped); err != nil {
		return "", errorMap(err)
	}
	return id, nil
}
1155177
func (s *TestEventPatternInput) SetEvent(v string) *TestEventPatternInput {
	s.Event = &v
	return s
}