How do their APIs compare?
How do their APIs compare?
About netflix/hystrix · 2 messages · last activity 8/15/2026
Comparing "APIs" across these two projects is a bit apples-to-oranges since they serve very different purposes, but here's how they line up based on what's in the retrieved data:
netflix/hystrix — a runtime resilience library API
Hystrix exposes APIs meant to be called at application runtime to wrap and protect calls to remote/risky dependencies:
- Annotation-based API (hystrix-javanica module): developers annotate methods with
@HystrixCommand(and@CacheRemove) rather than writing explicit command classes. This is enabled via AspectJ weaving, configured either throughaop.xmlreferencingcom.netflix.hystrix.contrib.javanica.aop.aspectj.HystrixCommandAspect, or via Spring AOP/Spring Java config registeringHystrixCommandAspectas a bean [hystrix-contrib/hystrix-javanica/README.md:L19-L38]. There's also aHystrixCacheAspectfor cache-eviction annotations used outside of commands [hystrix-contrib/hystrix-javanica/README.md:L595-L606]. - Clojure API (hystrix-clj): wraps a plain function using
defcommand, turning it into a Hystrix-protected command that can be invoked synchronously or queued for async execution viaqueue[hystrix-contrib/hystrix-clj/README.md:L35-L60]. - Metrics/streaming HTTP APIs (hystrix-metrics-event-stream-jaxrs): JAX-RS resource classes expose REST-style endpoints for monitoring, e.g.
HystrixRequestEventsSseControllerat path/hystrix/request.stream[hystrix-contrib/hystrix-metrics-event-stream-jaxrs/.../HystrixRequestEventsSseController.java:L36-L50] andHystrixConfigSseControllerat/hystrix/config.stream, which streams config viaHystrixConfigurationStream/SerialHystrixConfiguration[hystrix-contrib/hystrix-metrics-event-stream-jaxrs/.../HystrixConfigSseController.java:L29-L49]. These build on a sharedAbstractHystrixStreamControllerbase [hystrix-contrib/hystrix-metrics-event-stream-jaxrs/.../AbstractHystrixStreamController.java:L15-L36].
So Hystrix's "API surface" is oriented around command execution and observability — annotate/wrap a call, then optionally scrape its state over HTTP/SSE streams.
pxb1988/dex2jar — a compiler-IR-style library API
dex2jar's retrieved code is all from the dex-ir module, which models an intermediate representation (IR) for translating Dalvik bytecode toward JVM bytecode. Its API is a data-structure / transformation API, not a runtime service API:
- Core IR types:
IrMethod,Trap(exception handler ranges tied toLabelStmt) [dex-ir/.../ir/Trap.java:L16-L24],StmtList(a statement list withLabelAndLocalMappersupport) [dex-ir/.../ir/stmt/StmtList.java:L16-L28], andStmtsfactory helpers [dex-ir/.../ir/stmt/Stmts.java:L16-L18]. - Expression types modeling invocations:
InvokeExprfor interface/special/virtual/static/new invocations [dex-ir/.../ir/expr/InvokeExpr.java:L16-L35],AbstractInvokeExpras a shared base [dex-ir/.../ir/expr/AbstractInvokeExpr.java:L16-L19],InvokeCustomExprforinvokedynamic-style call sites usingCallSite/Proto[dex-ir/.../ir/expr/InvokeCustomExpr.java:L16-L19], and anExprsfactory that builds expressions usingCallSite,DexType,Method,MethodHandle,Proto[dex-ir/.../ir/expr/Exprs.java:L16-L22]. - Transformation API: an abstract
Transformerclass that operates over anIrMethod[dex-ir/.../ir/ts/Transformer.java:L16-L19] — this is the extension point for IR optimization/simplification passes.
So dex2jar's API
Want to ask your own question?
Open chat for netflix/hystrixPublic Q&A. Generated by RepoPilot from the actual source of netflix/hystrix. AI answers can be incomplete or stale — verify before relying on them.