-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into update-from-template-merged
- Loading branch information
Showing
15 changed files
with
465 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# 1.0.3 | ||
* Improve performance when using virtual threads #49 | ||
* Updated dependencies | ||
|
||
# 1.0.2 | ||
* Fixed possible NPE when shutting down | ||
|
||
# 1.0.1 | ||
* Restore original logging with SLF4j | ||
|
||
# 1.0.0 | ||
_Initial release_ |
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
47 changes: 47 additions & 0 deletions
47
expiring-limited-cache-demo/src/main/java/software/xdev/Application.java
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,47 @@ | ||
package software.xdev; | ||
|
||
import java.time.Duration; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import software.xdev.caching.ExpiringLimitedCache; | ||
|
||
|
||
public final class Application | ||
{ | ||
private static final Logger LOG = LoggerFactory.getLogger(Application.class); | ||
|
||
private static final ExpiringLimitedCache<Integer, String> CACHE = new ExpiringLimitedCache<>( | ||
"demo", | ||
Duration.ofSeconds(2), | ||
1 | ||
); | ||
|
||
@SuppressWarnings("java:S2629") // No we don't write if everywhere now | ||
public static void main(final String[] args) | ||
{ | ||
CACHE.put(1, "HI"); | ||
CACHE.put(2, "DEMO"); | ||
// Returns null as size > max | ||
LOG.info("1={}", CACHE.get(1)); | ||
LOG.info("2={}", CACHE.get(2)); | ||
|
||
LOG.info("Waiting a moment..."); | ||
try | ||
{ | ||
Thread.sleep(3 * 1000L); | ||
} | ||
catch(final InterruptedException iex) | ||
{ | ||
Thread.currentThread().interrupt(); | ||
} | ||
|
||
// Will also return null as expired | ||
LOG.info("2={}", CACHE.get(2)); | ||
} | ||
|
||
private Application() | ||
{ | ||
} | ||
} |
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
Oops, something went wrong.