// SubmitWithOptions submits (or updates) the CloudFormation stack for the app.
494855
func (s *Scheduler) SubmitWithOptions(ctx context.Context, app *twelvefactor.Manifest, ss twelvefactor.StatusStream, opts SubmitOptions) error {
	tx, err := s.db.Begin()
	if err != nil {
		return err
	}

	err = s.submit(ctx, tx, app, ss, opts)
	if err != nil {
		tx.Rollback()
		return err
	}
	return tx.Commit()
}
1204596
func (c *runner) RunWithOptions(opts CommandOpts, name string, arg ...string) error {
	cmd := exec.Command(name, arg...)
	if opts.Stdout != nil {
		cmd.Stdout = opts.Stdout
	}
	if opts.Stderr != nil {
		cmd.Stderr = opts.Stderr
	}
	if opts.Dir != "" {
		cmd.Dir = opts.Dir
	}
	if len(opts.EnvAppend) > 0 {
		cmd.Env = os.Environ()
		cmd.Env = append(cmd.Env, opts.EnvAppend...)
	}
	return cmd.Run()
}
1198193
func (instanceApi *InstanceApi) ListWithOptions(options map[string]string) ([]Instance, error) {
	data, err := instanceApi.entityService.List(options)
	if err != nil {
		return nil, err
	}
	return parseInstanceList(data), nil
}
727174
func (s *Span) FinishWithOptions(opts opentracing.FinishOptions) {
	s.ClientFinishWithOptions(DefaultClient, opts)
}
1229605
func ListenWithOptions(laddr string, block BlockCrypt, dataShards, parityShards int) (*Listener, error) {
	udpaddr, err := net.ResolveUDPAddr("udp", laddr)
	if err != nil {
		return nil, errors.Wrap(err, "net.ResolveUDPAddr")
	}
	conn, err := net.ListenUDP("udp", udpaddr)
	if err != nil {
		return nil, errors.Wrap(err, "net.ListenUDP")
	}

	return ServeConn(block, dataShards, parityShards, conn)
}
957214
func (t *Tree) SetWithOptions(key string, opts SetOptions, value interface{}) {
	t.SetPathWithOptions(strings.Split(key, "."), opts, value)
}
1329658
func (c *Client) SubmitBlockAsync(block *btcutil.Block, options *btcjson.SubmitBlockOptions) FutureSubmitBlockResult {
	blockHex := ""
	if block != nil {
		blockBytes, err := block.Bytes()
		if err != nil {
			return newFutureError(err)
		}

		blockHex = hex.EncodeToString(blockBytes)
	}

	cmd := btcjson.NewSubmitBlockCmd(blockHex, options)
	return c.sendCmd(cmd)
}
339359
func WithResults(funcResults ...*OperationResult) Opt {
	return func(opts *Opts) {
		opts.Operations = make(map[Operation]ResultDesc)
		for _, fr := range funcResults {
			opts.Operations[fr.Operation] = ResultDesc{Result: fr.Result, ErrMsg: fr.ErrMessage}
		}
	}
}
984156
func Submit(options *Options) []Result {
	log.Printf("search : Submit : Started : %#v\n", options)

	var final []Result
	searchers := make(map[string]Searcher)
	searchResults := make(chan []Result)

	// Create a Google Searcher if checked.
	if options.Google {
		log.Println("search : Submit : Info : Adding Google")
		searchers["google"] = NewGoogle()
	}

	// Create a Bing Searcher if checked.
	if options.Bing {
		log.Println("search : Submit : Info : Adding Bing")
		searchers["bing"] = NewBing()
	}

	// Create a Bing Searcher if checked.
	if options.Blekko {
		log.Println("search : Submit : Info : Adding Blekko")
		searchers["blekko"] = NewBlekko()
	}

	// Perform the searches concurrently. Using a map because
	// it returns the searchers in a random order every time.
	for _, searcher := range searchers {
		go searcher.Search(options.SearchTerm, searchResults)
	}

	// Wait for the results to come back.
	for search := 0; search < len(searchers); search++ {
		// If we just want the first result, don't wait any longer by
		// concurrently discarding the remaining searchResults.
		// Failing to do so will leave the Searchers blocked forever.
		if options.First && search > 0 {
			go func() {
				results := <-searchResults
				log.Printf("search : Submit : Info : Results Discarded : Results[%d]\n", len(results))
			}()
			continue
		}

		// Wait to recieve results.
		log.Println("search : Submit : Info : Waiting For Results...")
		results := <-searchResults

		// Save the results to the final slice.
		log.Printf("search : Submit : Info : Results Used : Results[%d]\n", len(results))
		final = append(final, results...)
	}

	log.Printf("search : Submit : Completed : Found [%d] Results\n", len(final))
	return final
}
1036580
func WithProviderOpts(sopts ...coptions.Opt) Option {
	return func(opts *options) error {
		opts.ProviderOpts = append(opts.ProviderOpts, sopts...)
		return nil
	}
}
788168
func (h *bundleHandler) setOptions(change *bundlechanges.SetOptionsChange) error {
	p := change.Params
	h.ctx.Verbosef("  setting options:")
	for key, value := range p.Options {
		switch value.(type) {
		case string:
			h.ctx.Verbosef("    %s: %q", key, value)
		default:
			h.ctx.Verbosef("    %s: %v", key, value)
		}
	}
	if h.dryRun {
		return nil
	}

	// We know that there wouldn't be any setOptions if there were no options.
	cfg, err := yaml.Marshal(map[string]map[string]interface{}{p.Application: p.Options})
	if err != nil {
		return errors.Annotatef(err, "cannot marshal options for application %q", p.Application)
	}

	if err := h.api.Update(params.ApplicationUpdate{
		ApplicationName: p.Application,
		SettingsYAML:    string(cfg),
		Generation:      model.GenerationMaster,
	}); err != nil {
		return errors.Annotatef(err, "cannot update options for application %q", p.Application)
	}

	return nil
}
681216
func (s *Service) Submit(event interface{}) error {
	defer func() {
		// During shutdown, events may still be produced and we may
		// get a 'send on closed channel' panic. Just log and ignore the error.
		if p := recover(); p != nil {
			logger.Warnf("panic while submitting event: %s", p)
			debug.PrintStack()
		}
	}()

	eventch, err := s.dispatcher.EventCh()
	if err != nil {
		return errors.WithMessage(err, "Error submitting to event dispatcher")
	}
	eventch <- event

	return nil
}
14437
func WithTransforms(t []*Transform) OptionFunc {
	return func(n *Node) error {
		n.transforms = t
		return nil
	}
}
177860
func ServeWithOptions(servers []*http.Server, options ...option) error {
	a := newApp(servers)
	for _, opt := range options {
		opt(a)
	}
	return a.run()
}
859777
func NewWithOptions(
	out io.Writer,
	lvl logrus.Level,
	formatter logrus.Formatter) gournal.Appender {

	return &appender{&logrus.Logger{Out: out, Level: lvl, Formatter: formatter}}
}
855625
func Submit(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "submit", Listener: listener}
}
1320370
func NewWithOptions(o Options) *Server {
	var listener *Listener
	if o.Listener != nil {
		g, ok := o.Listener.(*Listener)
		if !ok {
			listener = NewListener(o.Listener)
		} else {
			listener = g
		}
	}
	if o.Server == nil {
		o.Server = new(http.Server)
	}
	return &Server{
		Server:           o.Server,
		listener:         listener,
		stateHandler:     o.StateHandler,
		shutdown:         make(chan bool),
		shutdownFinished: make(chan bool, 1),
		wg:               new(sync.WaitGroup),
		connToProps:      make(map[net.Conn]connProperties),
	}
}