Skip to content

feat: implement failsafe execute and execute-async, along with policy builders#1

Merged
k13gomez merged 1 commit intomainfrom
impl
Oct 22, 2025
Merged

feat: implement failsafe execute and execute-async, along with policy builders#1
k13gomez merged 1 commit intomainfrom
impl

Conversation

@k13gomez
Copy link
Member

@k13gomez k13gomez commented Oct 21, 2025

Initial release providing idiomatic Clojure wrappers for Failsafe.dev.

Features

  • Policy builders: retry, circuit-breaker, fallback, timeout, rate-limiter, bulkhead
  • Synchronous execution via execute
  • Asynchronous execution via execute-async with futurama integration
  • Policy composition support
  • Event callbacks for observability
  • Comprehensive test coverage across Clojure 1.10, 1.11, 1.12
  • GraalVM native image support

@k13gomez k13gomez requested a review from Copilot October 21, 2025 16:33
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements the core functionality for the failsafe library, providing a Clojure wrapper around the Java Failsafe library for resilience patterns like retries, circuit breakers, and rate limiting. The implementation includes policy builders for various failure handling strategies and execution functions for both synchronous and asynchronous operations.

  • Implements policy builders for bulkhead, circuit breaker, fallback, rate limiter, retry, and timeout
  • Adds synchronous and asynchronous execution functions with Failsafe integration
  • Removes Java options configuration from Makefile related to executor factory

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/failsage/impl.clj Implements protocol for policy builders, type conversions for Failsafe interop, and core execution functions
src/failsage/core.clj Defines public API for creating Failsafe policies and executors with Clojure-friendly configuration maps
Makefile Removes executor factory Java options that are no longer needed
Comments suppressed due to low confidence (1)

src/failsage/core.clj:1

  • Double period detected - should be a single period before 'Default'.
(ns failsage.core

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@hiredman
Copy link
Collaborator

it doesn't seem like :on-failure-fn for retry or the result supplying function for fallback can be async (:on-failure-fn can be fire and forget async, but wild about the idea of potentially spinning up unbounded tasks while something is failing). Not sure what consequences of that will be. might make transforming something like (async (try (!<! (do-something)) (catch Exception e (!<! (record-failure e))))) into a retry usage kind of awkward

@k13gomez k13gomez changed the title Draft: implement failsafe execute and execute-async, along with policy builders feat: implement failsafe execute and execute-async, along with policy builders Oct 21, 2025
@k13gomez k13gomez marked this pull request as ready for review October 21, 2025 18:06
Copy link
Collaborator

@hiredman hiredman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@k13gomez k13gomez force-pushed the impl branch 2 times, most recently from 37bfaee to 03ff5db Compare October 22, 2025 02:35
@k13gomez k13gomez merged commit a256ed0 into main Oct 22, 2025
7 checks passed
@k13gomez k13gomez deleted the impl branch October 22, 2025 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants