-
Notifications
You must be signed in to change notification settings - Fork 691
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add module * Add module * peko streams * Bump Scala 3 to 3.3.0 and make pekkostreams compile to 3 * Remove scalamock * Remove scalamock * Fix for Scala 3 * Scala 3.3.0 in build
- Loading branch information
Showing
20 changed files
with
1,332 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
com.sksamuel.elastic4s.pekko { | ||
hosts = [] | ||
https = false | ||
verify-ssl-certificate = true | ||
// optionally provide credentials | ||
// username = ... | ||
// password = ... | ||
queue-size = 1000 | ||
blacklist { | ||
min-duration = 1m | ||
max-duration = 30m | ||
} | ||
max-retry-timeout = 30s | ||
pekko.http { | ||
// pekko-http settings specific for elastic4s | ||
// can be overwritten in this section | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
elastic4s-client-pekko/src/main/scala/com/sksamuel/elastic4s/pekko/Blacklist.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.sksamuel.elastic4s.pekko | ||
|
||
/** | ||
* List of 'bad' hosts. | ||
* Implementation must have expiration logic backed-in. | ||
*/ | ||
private[pekko] trait Blacklist { | ||
|
||
/** | ||
* Adds a host to the blacklist. | ||
* | ||
* @param host host | ||
* @return true if record is blacklisted for the first time | ||
*/ | ||
def add(host: String): Boolean | ||
|
||
/** | ||
* Removes a host from the blacklist. | ||
* | ||
* @param host host | ||
* @return true if host was blacklisted | ||
*/ | ||
def remove(host: String): Boolean | ||
|
||
/** | ||
* Checks if a host can be used. | ||
* | ||
* @param host host | ||
* @return true if host is not in a blacklist or temporary removed from it | ||
*/ | ||
def contains(host: String): Boolean | ||
|
||
/** | ||
* Number of hosts in blacklist | ||
*/ | ||
def size: Int | ||
|
||
/** | ||
* List all hosts in the blacklist | ||
* | ||
* @return | ||
*/ | ||
def list: List[String] | ||
} | ||
|
Oops, something went wrong.