sdeleuze
ReceiveChannel
BroadcastChannel
Jonathan
private val notificationBroadcast = BroadcastChannel(1).apply { launch { val count = articleEventRepository.count().toInt() articleEventRepository.findWithTailableCursorBy().drop(count).consumeEach { send(it) } } } @GetMapping("/notifications", produces = [(MediaType.TEXT_EVENT_STREAM_VALUE)]) suspend fun notifications(): ReceiveChannel<ArticleEvent> = notificationBroadcast.openSubscription()
A modern programming language that makes developers happier.