• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3  */
4 
5 package kotlinx.coroutines.flow.internal
6 
7 import kotlinx.coroutines.*
8 import kotlinx.coroutines.channels.*
9 import kotlinx.coroutines.flow.*
10 
11 /**
12  * Collection that sends to channel
13  * @suppress **This an internal API and should not be used from general code.**
14  */
15 @InternalCoroutinesApi
16 public class SendingCollector<T>(
17     private val channel: SendChannel<T>
18 ) : FlowCollector<T> {
emitnull19     override suspend fun emit(value: T): Unit = channel.send(value)
20 }
21