// NewSystemChannel creates a new system channel message processor.
961778
func NewSystemChannel(support StandardChannelSupport, templator ChannelConfigTemplator, filters *RuleSet) *SystemChannel {
	logger.Debugf("Creating system channel msg processor for channel %s", support.ChainID())
	return &SystemChannel{
		StandardChannel: NewStandardChannel(support, filters),
		templator:       templator,
	}
}
324257
func CreateSystemChannelFilters(chainCreator ChainCreator, ledgerResources channelconfig.Resources) *RuleSet {
	ordererConfig, ok := ledgerResources.OrdererConfig()
	if !ok {
		logger.Panicf("Cannot create system channel filters without orderer config")
	}
	return NewRuleSet([]Rule{
		EmptyRejectRule,
		NewExpirationRejectRule(ledgerResources),
		NewSizeFilter(ordererConfig),
		NewSigFilter(policies.ChannelWriters, ledgerResources),
		NewSystemChannelFilter(ledgerResources, chainCreator),
	})
}
1002455
func NewSystemCpufreq() ([]SystemCPUCpufreqStats, error) {
	fs, err := NewFS(DefaultMountPoint)
	if err != nil {
		return []SystemCPUCpufreqStats{}, err
	}

	return fs.NewSystemCpufreq()
}
354709
func NewStructure(reader kv.Retriever, readWriter kv.RetrieverMutator, prefix []byte) *TxStructure {
	return &TxStructure{
		reader:     reader,
		readWriter: readWriter,
		prefix:     prefix,
	}
}
667023
func NewSystemTime(TIME_UNIX_USEC uint64, TIME_BOOT_MS uint32) *SystemTime {
	m := SystemTime{}
	m.TIME_UNIX_USEC = TIME_UNIX_USEC
	m.TIME_BOOT_MS = TIME_BOOT_MS
	return &m
}
333907
func (bot *ExchangeBot) UpdateChannels() *UpdateChannels {
	update := make(chan *ExchangeUpdate, 16)
	index := make(chan *IndexUpdate, 16)
	quit := make(chan struct{})
	bot.mtx.Lock()
	defer bot.mtx.Unlock()
	bot.updateChans = append(bot.updateChans, update)
	bot.indexChans = append(bot.indexChans, index)
	bot.quitChans = append(bot.quitChans, quit)
	return &UpdateChannels{
		Exchange: update,
		Index:    index,
		Quit:     quit,
	}
}
671877
func NewUpdateChannels() *UpdateChannels {
	return &UpdateChannels{
		Exchange: make(chan *ExchangeUpdate, 16),
		Index:    make(chan *IndexUpdate, 16),
		Quit:     make(chan struct{}),
	}
}
429621
func (bot *TgBot) StartWithMessagesChannel(ch chan MessageWithUpdateID) {
	go bot.MessagesHandler(ch)
	bot.Start()
}
1119735
func writeChannel(real bool) wsstream.ChannelType {
	if real {
		return wsstream.WriteChannel
	}
	return wsstream.IgnoreChannel
}
84388
func NewServiceManager(channelSize uint) *ServiceManager {

	in := make(chan interface{}, channelSize)

	return &ServiceManager{in: in}
}
35254
func (fbo *folderBranchOps) NewNotificationChannel(
	ctx context.Context, handle *tlfhandle.Handle, convID chat1.ConversationID,
	channelName string) {
	monitoringCh := fbo.getEditMonitoringChannel()
	if monitoringCh == nil {
		fbo.vlog.CLogf(
			ctx, libkb.VLog1,
			"Ignoring new notification channel while edits are unmonitored")
		return
	}

	fbo.vlog.CLogf(
		ctx, libkb.VLog1, "New notification channel: %s %s",
		convID, channelName)
	fbo.editActivity.Add(1)
	select {
	case fbo.editChannels <- editChannelActivity{convID, channelName, ""}:
	case <-monitoringCh:
		fbo.editActivity.Done()
		fbo.log.CDebugf(ctx, "Edit monitoring stopped while trying to "+
			"send new notification channel")
	}
}
1224183
func (n *NotifyRouter) GetChannels(i ConnectionID) keybase1.NotificationChannels {
	return n.getNotificationChannels(i)
}
1129112
func (s *StartFaceSearchInput) SetNotificationChannel(v *NotificationChannel) *StartFaceSearchInput {
	s.NotificationChannel = v
	return s
}
1266768
func NewSynchClient() (c Client, err Error) {
	spec := DefaultSpec()
	c, err = NewSynchClientWithSpec(spec)
	if err != nil {
		log.Println("NewSynchClientWithSpec raised error: ", err)
	}
	if c == nil {
		log.Println("NewSynchClientWithSpec returned nil Client.")
		err = newSystemError("NewSynchClientWithSpec returned nil Client")
	}
	return
}
14007
func NewServer(options *Options) *Server {
	if options == nil {
		options = &Options{
			Logger: log.New(os.Stdout, "go-sse: ", log.LstdFlags),
		}
	}

	if options.Logger == nil {
		options.Logger = log.New(ioutil.Discard, "", log.LstdFlags)
	}

	s := &Server{
		options,
		make(map[string]*Channel),
		make(chan *Client),
		make(chan *Client),
		make(chan bool),
		make(chan string),
	}

	go s.dispatch()

	return s
}
567639
func (c *UsergroupsCreateCall) Channels(channels string) *UsergroupsCreateCall {
	c.channels = channels
	return c
}
89851
func (s *Session) ChannelMessageAck(channelID, messageID, lastToken string) (st *Ack, err error) {

	body, err := s.RequestWithBucketID("POST", EndpointChannelMessageAck(channelID, messageID), &Ack{Token: lastToken}, EndpointChannelMessageAck(channelID, ""))
	if err != nil {
		return
	}

	err = unmarshal(body, &st)
	return
}