emo / me.eater.emo.utils

Package me.eater.emo.utils

Types

Event

class Event<T> : Iterable<MutableEntry<String, suspend (T) -> Unit>>

Simple class that can hold callbacks for events

Noop

class Noop : Process<Any>

Noop process, useful when only routing is needed

NoopDeserializer

class NoopDeserializer : Deserializable<Unit>

Process

interface Process<in C>

Process interface

ProcessChain

data class ProcessChain<C>

Process chain, contains the name of the process, the router, the name of this step and the description of this step

ProcessStartedEvent

data class ProcessStartedEvent<C>

Event that is executed when a new process is started in a workflow

Router

interface Router<C>

Used to select the next step in a workflow

StaticRouter

class StaticRouter<C> : Router<C>

Router that always returns the same result

Workflow

class Workflow<C>

Workflow object

WorkflowBuilder

class WorkflowBuilder<C>

Workflow builder, used to create a new workflow

WorkflowEvent

data class WorkflowEvent<C>

Generic workflow event

Extensions for External Classes

com.github.kittinunf.fuel.core.Request

Functions

io

suspend fun <T> io(start: CoroutineStart = CoroutineStart.DEFAULT, block: suspend CoroutineScope.() -> T): T

Run function on IO thread

parallel

suspend fun <T> parallel(items: Iterable<T>, parallel: Int = 10, call: suspend (T) -> Unit): Unit

like .forEach but in parallel, amount of processes is determined by parallel