effect-managed-runtime

Run Effect services from non-Effect code via ManagedRuntime and runPromise.

22|1|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/mpsuesser/pi-effect-harness --skill effect-managed-runtime
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-managed-runtime
Source: https://github.com/mpsuesser/pi-effect-harness/tree/main/harnesses/effect/skills/effect-managed-runtime
Command: npx skills add https://github.com/mpsuesser/pi-effect-harness --skill effect-managed-runtime

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

You need to use Effect services in an environment where Effect does not own the process lifecycle, such as Hono/Express handlers or serverless functions, without manually re-implementing runtime and lifecycle concerns.

Core Features & Use Cases

  • Bridge Effect to External Frameworks: Run Effects from non-Effect code paths using ManagedRuntime in HTTP handlers, serverless functions, or embedded contexts.
  • Correct Lifecycle & Resource Safety: Dispose the runtime to release resources acquired during layer construction (DB pools, clients, file handles).
  • Deterministic Execution Options: Use runPromise for async handlers, runSync for known-sync effects, and runFork/runCallback for alternative execution styles.
  • Integration Ready: Includes guidance and examples for Hono, Express, AWS Lambda, and Cloudflare Workers, plus key contrasts vs Layer.launch and runMain.

Quick Start

Use the effect-managed-runtime skill to run your Effect services inside a Hono or Express route by constructing a ManagedRuntime from your app layer and calling runtime.runPromise within the handler.

Frequently Asked Questions about effect-managed-runtime

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run Effect services inside an Express or Hono HTTP handler?

To run Effect services inside HTTP handlers, construct a ManagedRuntime from a fully-satisfied Layer and call runtime.runPromise within the route handler to execute effects from non-Effect code paths.

What is the best way to manage Effect runtime lifecycle in serverless functions?

Managing Effect runtime lifecycle in serverless functions requires explicitly disposing the runtime after execution to safely release acquired resources like DB pools and file handles constructed during Layer creation.

Does Effect ManagedRuntime work with AWS Lambda and Cloudflare Workers?

Yes, Effect ManagedRuntime works with AWS Lambda and Cloudflare Workers by bridging your Layer into framework-controlled runtimes where the external serverless platform owns the process lifecycle.

Why should I use ManagedRuntime instead of Layer.launch for integration tests?

You should use ManagedRuntime instead of Layer.launch for integration tests because it bridges Effect into embedded contexts where the external framework owns the process, allowing deterministic execution via runPromise or runSync.

How do I safely release database pools when running Effect in non-Effect code?

To safely release database pools when running Effect in non-Effect code, explicitly dispose the ManagedRuntime after executing effects to release resources acquired during layer construction.