You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

LabelledResponseHandler.kt 610B

1234567891011121314151617181920
  1. package com.dmdirc.ktirc.events.handlers
  2. import com.dmdirc.ktirc.IrcClient
  3. import com.dmdirc.ktirc.events.IrcEvent
  4. import kotlinx.coroutines.GlobalScope
  5. import kotlinx.coroutines.launch
  6. internal class LabelledResponseHandler : EventHandler {
  7. override fun processEvent(client: IrcClient, event: IrcEvent) {
  8. client.serverState.asyncResponseState.pendingResponses.values
  9. .filter { it.second(event) }
  10. .forEach {
  11. GlobalScope.launch {
  12. it.first.send(event)
  13. }
  14. }
  15. }
  16. }