semian
semian copied to clipboard
Enrich to_s for Resources classes.
When working with Semian, found to be usefull have light version of Resource.
Provide more informaion for string represintation of Semian:ProtectedResource,
Semian:Resource, and Semian:CircuitBreaker instances.
Change the return value of to_s from class name with address to
class name with some fields.
Example:
"#<Semian::ProtectedResource:0x0000ffffa6f38558>"->#<Semian::ProtectedResource name: testing, circuit_breaker: #<Semian::CircuitBreaker name: testing, half_open_resource_timeout: , error_timeout: 5, closed?: true, open?: false, half_open?: false, last_error: >, bulkhead: #<Semian::Resource name: testing>>"#<Semian::CircuitBreaker:0x0000ffffa6f3a830>"->#<Semian::CircuitBreaker name: testing, half_open_resource_timeout: , error_timeout: 5, closed?: true, open?: false, half_open?: false, last_error: >"#<Semian::Resource:0x0000ffffa6f38d00>"->#<Semian::Resource name: testing>
Rethinking of implementation details base on Peter comment to have it more user friendly and less information.