Skip to content

Commit

Permalink
Validate documentation of usage ActiveRecord (#473)
Browse files Browse the repository at this point in the history
* Mention about trilogy adapter in readme
* Add section for active record configuration
  • Loading branch information
miry authored Feb 14, 2023
1 parent 154f31b commit d489262
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ version is the version of the public gem with the same name:
* [`semian/mysql2`][mysql-semian-adapter] (~> 0.3.16)
* [`semian/redis`][redis-semian-adapter] (~> 3.2.1)
* [`semian/net_http`][nethttp-semian-adapter]
* [`semian/activerecord_trilogy_adapter`][activerecord-trilogy-semian-adapter]
* [`semian-postgres`][postgres-semian-adapter]

### Creating Adapters
Expand Down Expand Up @@ -299,6 +300,35 @@ SEMIAN_PARAMETERS = { tickets: 1,
open_circuit_server_errors: true }
```

#### Active Record

Semian supports Active Record adapter `trilogy`.
It can be configured in the `database.yml`:

```yml
semian: &semian
success_threshold: 2
error_threshold: 3
error_timeout: 4
half_open_resource_timeout: 1
bulkhead: false # Disable bulkhead for Puma: https://github.com/shopify/semian#thread-safety
name: semian_identifier_name

default: &default
adapter: trilogy
username: root
password:
host: localhost
read_timeout: 2
write_timeout: 1
connect_timeout: 1
semian:
<<: *semian
```
Example cases for `activerecord-trilogy-adapter` can be run using
`BUNDLE_GEMFILE=gemfiles/activerecord_trilogy_adapter.gemfile bundle exec rake examples:activerecord_trilogy_adapter`

# Understanding Semian

Semian is a library with heuristics for failing fast. This section will explain
Expand Down

0 comments on commit d489262

Please sign in to comment.