semian icon indicating copy to clipboard operation
semian copied to clipboard

Enrich to_s for Resources classes.

Open miry opened this issue 3 years ago • 1 comments

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>

miry avatar Sep 23 '22 20:09 miry

Rethinking of implementation details base on Peter comment to have it more user friendly and less information.

miry avatar Sep 27 '22 13:09 miry