Package com.github.shynixn.mccoroutine.bungeecord

Types

CoroutineSession
Link copied to clipboard
interface CoroutineSession

Facade of a coroutine session of a single plugin.

MCCoroutine
Link copied to clipboard
interface MCCoroutine
MCCoroutineExceptionEvent
Link copied to clipboard
class MCCoroutineExceptionEvent(plugin: <ERROR CLASS>, exception: Throwable)

A BungeeCord event which is called when an exception is raised in one of the coroutines managed by MCCoroutine. Cancelling this exception causes the error to not get logged and offers to possibility for custom logging.

SuspendingCommand
Link copied to clipboard
abstract class SuspendingCommand
SuspendingPlugin
Link copied to clipboard
open class SuspendingPlugin

Functions

launch
Link copied to clipboard
fun <ERROR CLASS>.launch(context: CoroutineContext = bungeeCordDispatcher, start: <ERROR CLASS> = CoroutineStart.DEFAULT, block: suspend <ERROR CLASS>.() -> Unit): <ERROR CLASS>

Launches a new coroutine on the BungeeCord Plugin ThreadPool without blocking the current thread and returns a reference to the coroutine as a Job. The coroutine is cancelled when the resulting job is Job.cancel.

registerSuspendingCommand
Link copied to clipboard
fun <ERROR CLASS>.registerSuspendingCommand(plugin: <ERROR CLASS>, command: SuspendingCommand)

Registers an command executor with suspending function. Does exactly the same as PluginManager.registerCommand

registerSuspendingListener
Link copied to clipboard
fun <ERROR CLASS>.registerSuspendingListener(plugin: <ERROR CLASS>, listener: <ERROR CLASS>)

Registers an event listener with suspending functions. Does exactly the same thing as PluginManager.registerListener but makes suspension functions possible. Example:

Properties

bungeeCordDispatcher
Link copied to clipboard
val <ERROR CLASS>.bungeeCordDispatcher: CoroutineContext

Gets the plugin bungeeCord dispatcher.

scope
Link copied to clipboard
val <ERROR CLASS>.scope: <ERROR CLASS>

Gets the plugin coroutine scope.