ulo
ulo
Documentation

Start here

IntroductionInstallationQuick StartProject StructureDevelopment Workflow
Coming from NestJSNestJS topics, mapped

The model

Protocols

Integrations

Operating

Reference

Getting Started

Introduction

What Ulo is made of, how an application starts, and which pages to read in which order.

An Ulo application is a tree of modules. A module binds providers (services the container builds), controllers (structs whose methods answer requests, messages or calls) and the other modules it imports. Handlers name what they need in their signature, and the container supplies it.

Three choices are made in main, outside the module tree:

ChoiceCrateDecides
Runtimeulo-runtime-tokio or ulo-runtime-smolWhere tasks run and what the clock is
Serverulo-http-hyper, ulo-rpc-nats, ulo-grpc, ...Which protocol the application speaks, and on which socket
Listenerulo-listener-tokio or ulo-listener-smolWhich sockets the hyper-based servers accept on. ulo-http-hyper's default tokio feature picks the tokio listener. Without the feature, the server is written ServerOn<L> over the listener chosen

An application module does not name any of them, so the same module runs under a test, on tokio or on smol.

The five phases

main starts an application in phases, each a method on the value the previous one returned:

App::builder(AppModule) -> .runtime(..) -> .wire()? -> .connect().await? -> .bind(server) -> .listen().await? -> .serve(signal).await?
PhaseWhat happensWhat can fail
wireChecks the whole module graph: visibility, scopes, cycles, duplicates. No instance is built and no I/O happens.Every wiring problem, reported together
connectBuilds the singletons (one instance per application; see Scopes), runs readiness checks and the init and bootstrap hooksA provider that fails to build, a hook that errors
bindRegisters a server for the application to serve on
listenPrepares every server, then acquires the socketsEvery server's configuration problem together, then port conflicts
serveRuns until the signal future resolves or close is called, then drains

A job or a command stops after connect, runs work with execute, and calls close. Example 12-standalone shows this; see Standalone executions.

Where to read next

  1. Installation: dependency lines, Rust versions.
  2. Quick Start: a running route.
  3. Project Structure: what ulo new writes.
  4. Development Workflow: ulo dev.
  5. Coming from NestJS, if the model is familiar.

Documentation

A Rust framework for server applications with more than one kind of client, on a runtime and a server you choose.

Installation

Dependency lines for a tokio or smol application, Rust versions per crate, and installing the CLI.

On this page

The five phasesWhere to read next