arrow-resource

Kotlin + Arrow Resource lifecycle management with `Resource`, `ResourceScope`, and `resourceScope`. Use for designing safe acquisition/release of files, streams, DB pools/connections, HTTP clients, or multipart parts; composing resources (including parallel acquisition); or integrating Resource with typed errors and cancellation.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "arrow-resource" with this command: npx skills add alexandru/skills/alexandru-skills-arrow-resource

Arrow Resource (Kotlin)

Quick start

  • Use resourceScope { ... } at lifecycle boundaries.
  • Define each resource with resource { install(acquire) { a, exitCase -> release } }.
  • Compose with .bind(); use parZip for independent parallel acquisition.
  • Read references/resource.md for patterns and concrete examples.

Workflow

  1. Identify the acquire step and the release step.
  2. Implement a Resource<A> using install.
  3. Create reusable constructors on ResourceScope when needed.
  4. Compose resources into higher-level resources with .bind().
  5. Execute in resourceScope and keep finalizers idempotent.

Usage guidance

  • Prefer Resource over use/try/finally when you need suspend finalizers or MPP support.
  • Use ExitCase to handle rollback/cleanup differences.
  • When mixing with typed errors, pick nesting order deliberately to control ExitCase seen by finalizers.

References

  • Load references/resource.md for API details and end-to-end examples.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

cats-effect-io

No summary provided by upstream source.

Repository SourceNeeds Review
General

cats-effect-resource

No summary provided by upstream source.

Repository SourceNeeds Review
General

cats-mtl-typed-errors

No summary provided by upstream source.

Repository SourceNeeds Review
General

akka-streams

No summary provided by upstream source.

Repository SourceNeeds Review