Functional Kotlin Services
Functional Kotlin Services at Lambda World. Suspension, structured concurrency, resources, context parameters, and typed errors in one service.
The full text and code of the slides, one page per section.
- Functional Kotlin Services
- A service owns its work and its lifetime
- A service owns its work and its lifetime
- What is `suspend`?
- What is `suspend`?
- What is `suspend`?
- What is `suspend`?
- What is `suspend`?
- Server as a Resource
- Installing as a Resource
- Server as a Resource
- Processors share that lifetime
- Resources are released in reverse order
- Processors finish before dependencies close
- Configuring your server
- Configuring your Ktor server
- Configuring your Ktor server
- Ktor Routes using Spine
- Ktor Routes using Spine
- Calling Ktor Spine routes
- Ktor Routes using Spine
- When statement
- `Raise` adds an expected error to the signature
- `Raise` adds an expected error to the signature
- Validation
- Validation
- Validation
- Validation
- Validation
- Validation
- Validation
- Validation
- Validation
- Call directly in the route
- `|.` skips the call on an error
- `Raise` adds an expected error to the signature
- `Raise` adds an expected error to the signature
- Handling the error supplies `Raise`
- Ktor Routes using Spine
- Processors finish before dependencies close
- A null check refines the type
- `when` handles absence and guarded values
- A sealed interface names every outcome
- Context-sensitive resolution
- Check patterns with if-guard
- Destructuring follows property names
- Destructuring follows property names
- Collection literals
- Custom collection literals
- Custom collection literals
- `suspend`, `context`, and typed errors
- `suspend` is Continuation Passing Style
- `suspend` is Continuation Passing Style
- `suspend` is Continuation Passing Style
- `suspend` is cancellable
- `suspend` is cancellable
- `suspend` is cancellable
- Process events in parallel
- Process events in parallel
- Process events in parallel
- Process events in parallel
- Process events in parallel
- Process events in parallel
- Process events in parallel
- Process events in parallel
- `async` starts independent work
- Typed authentication
- Typed authentication
- Typed authentication
- Typed authentication
- Typed authentication