// On sets a default quad store for iteration. If qs was set, it may be omitted in other functions.
965623
func (c *IterateChain) On(qs QuadStore) *IterateChain {
	c.qs = qs
	return c
}
1140352
func (d *Dataset) OnDisk(fn func(*Dataset) *Dataset) *Dataset {
	ret := fn(d)

	var parents, currents []*Dataset
	currents = append(currents, ret)
	for {
		for _, t := range currents {
			isFirstDataset, isLastDataset := false, false
			if t == ret {
				isLastDataset = true
			} else if t.Step.OutputDataset != nil {
				t.Step.OutputDataset.Meta.OnDisk = ModeOnDisk
			}
			for _, p := range t.Step.InputDatasets {
				if p != d {
					parents = append(parents, p)
				} else {
					isFirstDataset = true
				}
			}
			if !isFirstDataset && !isLastDataset {
				t.Step.Meta.IsRestartable = true
			}
		}
		if len(parents) == 0 {
			break
		}
		currents = parents
		parents = nil
	}

	return ret
}
1199624
func (pool *BlockPool) OnStart() error {
	go pool.makeRequestersRoutine()
	pool.startTime = time.Now()
	return nil
}
1288668
func (a *Adaptor) On(event string, f func(msg Message)) bool {
	if a.client == nil {
		return false
	}
	a.client.Subscribe(event, 0, func(client paho.Client, msg paho.Message) {
		f(msg)
	})
	return true
}
532965
func (w *Writer) OnFooter(h plumbing.Hash) error {
	w.checksum = h
	w.finished = true
	_, err := w.createIndex()
	if err != nil {
		return err
	}

	return nil
}
1286690
func Apply(store *MemoryStore, item events.Event) (err error) {
	return store.Update(func(tx Tx) error {
		switch v := item.(type) {
		case api.EventCreateTask:
			return CreateTask(tx, v.Task)
		case api.EventUpdateTask:
			return UpdateTask(tx, v.Task)
		case api.EventDeleteTask:
			return DeleteTask(tx, v.Task.ID)

		case api.EventCreateService:
			return CreateService(tx, v.Service)
		case api.EventUpdateService:
			return UpdateService(tx, v.Service)
		case api.EventDeleteService:
			return DeleteService(tx, v.Service.ID)

		case api.EventCreateNetwork:
			return CreateNetwork(tx, v.Network)
		case api.EventUpdateNetwork:
			return UpdateNetwork(tx, v.Network)
		case api.EventDeleteNetwork:
			return DeleteNetwork(tx, v.Network.ID)

		case api.EventCreateNode:
			return CreateNode(tx, v.Node)
		case api.EventUpdateNode:
			return UpdateNode(tx, v.Node)
		case api.EventDeleteNode:
			return DeleteNode(tx, v.Node.ID)

		case state.EventCommit:
			return nil
		}
		return errors.New("unrecognized event type")
	})
}
749214
func (mysqld *Mysqld) OnTerm(f func()) {
	mysqld.mutex.Lock()
	defer mysqld.mutex.Unlock()
	mysqld.onTermFuncs = append(mysqld.onTermFuncs, f)
}
845992
func (c *Call) On(methodName string, arguments ...interface{}) *Call {
	return c.Parent.On(methodName, arguments...)
}
873640
func (sp *ServerPeer) OnHeaders(p *peer.Peer, msg *wire.MsgHeaders) {
	log.Tracef("Got headers with %d items from %s", len(msg.Headers),
		p.Addr())
	sp.server.blockManager.QueueHeaders(msg, sp)
}
1251736
func (d date) OnDate(clock, date time.Time) time.Time {
	tzAdjusted := date.In(clock.Location())
	return time.Date(tzAdjusted.Year(), tzAdjusted.Month(), tzAdjusted.Day(), clock.Hour(), clock.Minute(), clock.Second(), clock.Nanosecond(), clock.Location())
}
886469
func (s *Server) OnStart() error {
	go s.loop(state{
		queries: make(map[query.Query]map[string]chan interface{}),
		clients: make(map[string]map[query.Query]struct{}),
	})
	return nil
}
611812
func (qb *MySQLQueryBuilder) On(cond string) QueryBuilder {
	qb.Tokens = append(qb.Tokens, "ON", cond)
	return qb
}
766377
func (c *InMemoryCache) Set(_ context.Context, key Key, value Thunk) {
	c.items.Store(key.String(), value)
}
817509
func (l *List) OnKeyEvent(ev KeyEvent) {
	if !l.IsFocused() {
		return
	}

	switch ev.Key {
	case KeyUp:
		l.moveUp()
	case KeyDown:
		l.moveDown()
	case KeyEnter:
		if l.onItemActivated != nil {
			l.onItemActivated(l)
		}
	}

	switch ev.Rune {
	case 'k':
		l.moveUp()
	case 'j':
		l.moveDown()
	}
}
837799
func (g *Group) OnStart() error {
	g.ticker = time.NewTicker(g.groupCheckDuration)
	go g.processTicks()
	return nil
}
87814
func (b *Box) OnKeyEvent(ev KeyEvent) {
	for _, child := range b.children {
		child.OnKeyEvent(ev)
	}
}
451093
func (is *IndexerService) OnStart() error {
	// Use SubscribeUnbuffered here to ensure both subscriptions does not get
	// cancelled due to not pulling messages fast enough. Cause this might
	// sometimes happen when there are no other subscribers.

	blockHeadersSub, err := is.eventBus.SubscribeUnbuffered(context.Background(), subscriber, types.EventQueryNewBlockHeader)
	if err != nil {
		return err
	}

	txsSub, err := is.eventBus.SubscribeUnbuffered(context.Background(), subscriber, types.EventQueryTx)
	if err != nil {
		return err
	}

	go func() {
		for {
			msg := <-blockHeadersSub.Out()
			header := msg.Data().(types.EventDataNewBlockHeader).Header
			batch := NewBatch(header.NumTxs)
			for i := int64(0); i < header.NumTxs; i++ {
				msg2 := <-txsSub.Out()
				txResult := msg2.Data().(types.EventDataTx).TxResult
				if err = batch.Add(&txResult); err != nil {
					is.Logger.Error("Can't add tx to batch",
						"height", header.Height,
						"index", txResult.Index,
						"err", err)
				}
			}
			if err = is.idr.AddBatch(batch); err != nil {
				is.Logger.Error("Failed to index block", "height", header.Height, "err", err)
			} else {
				is.Logger.Info("Indexed block", "height", header.Height)
			}
		}
	}()
	return nil
}