- ..- .-. -... --- -.. ... .-.. - ..- .-. -... --- -.. ... .-..
___________ ______
___ ___/ __/ / ________ _____ ___
__ /__ __ _,___ / /_ ____ __ __ \ / ___/ / /
____ // / / // ___// __ \ / __ \ ____ / / / \ \ / /
__ // /_/ // / / (_/ // (_/ / __ /_/ /___\ \ / /___
_____/ \__,_//_/ /_,___/ \____/ _________//_____//______/
io.turbodsl
- ..- .-. -... --- -.. ... .-.. - ..- .-. -... --- -.. ... .-..
A DSL-engine to turbo-charge your Kotlin development.
io.turbodslwill not make your application faster, but will make your development easier, and most importantly, write asynchronous code in a natural way using DSL expressions.
io.turbodsl:io-turbodsl-core:1.2.6:- Support for Kotlin Multiplatform
- Removes JVM dependencies
io.turbodsl:io-turbodsl-core:1.2.5:Defaultincludes value evaluation- Main
executeScopeinRuntimeScopeuses scopedelayanddefaultimplicitly.- Only
RetryScopesets them explicitly.
- Only
- Changes
ScopeExcepiontoabstractfromsealedto allow subclassing from other modules.
io.turbodsl:io-turbodsl-core:1.2.4:Defaultconstants to represent0,1,-1.- Parameter
throwOnFailureforAsyncScopes. - Additional functions in
AsyncResult.
io.turbodsl:io-turbodsl-core:1.2.3:Defaultmechanisms update.- Introduce
itfor collection scopes. - Include prefix
asyncfor all collection DSL expressions.
io.turbodsl:io-turbodsl-core:1.2.2: Additional functionality for collections- Parallel processing on collections, adding functions for
map,filter,forEach,all,any,none, andcontains. - Multiple modes for collection asynchronous execution: parallel, buckets, pool.
- All extension-functions for collections use prefix
asyncto avoid naming mistakes with existing Kotlin functions. - Parallel flag added for
AsyncScopeto trigger sequential execution for debug / development purposes.
- Parallel processing on collections, adding functions for
io.turbodsl:io-turbodsl-core:1.2.1: Some-breaking changes- Default values for optional parameters - see Kotlin nullable generics and default values
- Changed:
defaultparameter has a default valueUndefined.Parameter - Added:
defaultFunparameter to avoid creating instances when a default value is not needed
- Changed:
- Added:
TurboDslErrorextendsErrorto separate scope-exception hierarchy. - Renamed
ScopeImplementationExceptionintoScopeImplementationError, extendingTurboDslError
- Default values for optional parameters - see Kotlin nullable generics and default values
io.turbodsl:io-turbodsl-core:1.2.0: Breaking changes- Rename
contexttoinput - Rename
dispatchertocontextto follow Kotlin standards forCoroutineContext - Retry-mechanisms extracted into
retry {...}expression - refactored to its ownRetryScope
- Rename
io.turbodsl:io-turbodsl-core:1.1.0: Minor bug fixesio.turbodsl:io-turbodsl-core:1.0.0: Initial release
// build.gradle.kts
repositories {
maven()
// Also through github-packages
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/migueltt/io-turbodsl")
credentials {
username = <github-user>
password = <github-personal-access-token>
}
}
}
dependencies {
implementation("io.turbodsl:io-turbodsl-core:<version>")
}
Check https://github.com/migueltt/io-turbodsl-tutorial
TurboScope.execute {
job { ... }
async(
job1 = asyncJob {...},
job2 = asyncJob {...},
// up to 10 jobs
job10 = asyncJob {...},
) { ok, r1, r2, ..., r10 ->
// process results
}
async {
// Add any number of asynchronous jobs
asyncJob {...}
:
}
}Check https://www.turbodsl.io
- Everything is based on DSL expressions using Kotlin approach
- Scopes are created internally to maintain structure and call hierarchy
- Each scope allows additional DSL expressions, making
TurboDSLusage more idiomatic - The runtime overhead is minimal, comparing to pure Kotlin coroutines implementation.
- Each scope has its own
input. If it is not explicitly specified, it inherits the parent'sinput.- This allows to avoid referencing variables across scopes.
- Provide immutability on how incoming data is processed. This is critical when having asynchronous code.
- Asynchronous execution allows 3 different modes:
AsyncMode.CancelNone: Continue even if any job fails.AsyncMode.CancelFirst: Cancel running jobs as soon as something fails, keeping results from those completed jobs.AsyncMode.CancelAll: If one job fails, cancel all other jobs.
- Introduce initial delays, if required.
- Specify timeout (maximum execution time), if required.
- Specify retry mechanisms:
- Number of retries
- Delays between retries.
- Delay factor to increase or decrease delay on subsequent retries
- Retry strategy:
RetryMode.OnTimeoutOnly: Retry only whentimeoutlimit has been reached.RetryMode.OnErrorOnly: Retry only when an unexpected error was thrown.RetryMode.Always: Retry always, for any error.RetryMode.Never: Never retry.