All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fireflysource.net.tcp.TcpCoroutineDispatcher Maven / Gradle / Ivy

There is a newer version: 5.0.2
Show newest version
package com.fireflysource.net.tcp;

import kotlinx.coroutines.CompletableJob;
import kotlinx.coroutines.CoroutineDispatcher;
import kotlinx.coroutines.CoroutineScope;

public interface TcpCoroutineDispatcher {

    /**
     * Get the coroutine dispatcher of this connection. One TCP connection is always in the same coroutine context.
     *
     * @return The coroutine dispatcher of this connection.
     */
    CoroutineDispatcher getCoroutineDispatcher();

    /**
     * Execute a task in the current TCP message process thread.
     *
     * @param runnable The runnable task.
     */
    void execute(Runnable runnable);

    /**
     * Get the coroutine scope of this connection.
     *
     * @return The coroutine scope.
     */
    CoroutineScope getCoroutineScope();

    /**
     * Get the supervisor job.
     *
     * @return The supervisor job.
     */
    CompletableJob getSupervisorJob();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy