Comments on: Useful & Unknown Java Features https://piotrminkowski.com/2022/01/05/useful-unknown-java-features/ Java, Spring, Kotlin, microservices, Kubernetes, containers Wed, 06 Sep 2023 13:55:35 +0000 hourly 1 https://wordpress.org/?v=6.9.1 By: piotr.minkowski https://piotrminkowski.com/2022/01/05/useful-unknown-java-features/#comment-2117 Wed, 06 Sep 2023 13:55:35 +0000 https://piotrminkowski.com/?p=10438#comment-2117 In reply to HyperTesto.

No problem 🙂

]]>
By: HyperTesto https://piotrminkowski.com/2022/01/05/useful-unknown-java-features/#comment-2116 Wed, 06 Sep 2023 13:37:29 +0000 https://piotrminkowski.com/?p=10438#comment-2116 DelayQueue seems a perfect fit for a project i’m starting. Thanks for the share!

]]>
By: piotr.minkowski https://piotrminkowski.com/2022/01/05/useful-unknown-java-features/#comment-1519 Fri, 25 Mar 2022 23:08:30 +0000 https://piotrminkowski.com/?p=10438#comment-1519 In reply to asdf.

Personally, I used concurrent accumulators, delay queues, and binary searches. The rest of them just for fun and know understand how it works

]]>
By: piotr.minkowski https://piotrminkowski.com/2022/01/05/useful-unknown-java-features/#comment-1358 Thu, 13 Jan 2022 12:44:35 +0000 https://piotrminkowski.com/?p=10438#comment-1358 In reply to michał.

Thanks 🙂 To be honest, I didn’t do anything on ECS, so I don’t feel competent in this area…

]]>
By: piotr.minkowski https://piotrminkowski.com/2022/01/05/useful-unknown-java-features/#comment-1357 Thu, 13 Jan 2022 12:42:02 +0000 https://piotrminkowski.com/?p=10438#comment-1357 In reply to asdffdsa10no.

Thanks 🙂

]]>
By: piotr.minkowski https://piotrminkowski.com/2022/01/05/useful-unknown-java-features/#comment-1355 Thu, 13 Jan 2022 12:39:13 +0000 https://piotrminkowski.com/?p=10438#comment-1355 In reply to ak.

Yes. Thanks the tip 🙂

]]>
By: ak https://piotrminkowski.com/2022/01/05/useful-unknown-java-features/#comment-1353 Wed, 12 Jan 2022 19:25:49 +0000 https://piotrminkowski.com/?p=10438#comment-1353 1. Delay Queue – may be use new Date-n-Time API instead of old System.currentTimeMillis();
See https://gist.github.com/ak-git/0edf178e5564005a82702f0e6fd0685d

]]>
By: michał https://piotrminkowski.com/2022/01/05/useful-unknown-java-features/#comment-1351 Tue, 11 Jan 2022 22:42:51 +0000 https://piotrminkowski.com/?p=10438#comment-1351 Awesome article, but i was wondering what about synchronisation between threads in different nodes of the same java app e.g. ECS nodes? Have you ever struggled with such a problem?

]]>
By: asdffdsa10no https://piotrminkowski.com/2022/01/05/useful-unknown-java-features/#comment-1350 Tue, 11 Jan 2022 16:25:14 +0000 https://piotrminkowski.com/?p=10438#comment-1350 good blog!

]]>
By: piotr.minkowski https://piotrminkowski.com/2022/01/05/useful-unknown-java-features/#comment-1346 Mon, 10 Jan 2022 11:26:41 +0000 https://piotrminkowski.com/?p=10438#comment-1346 In reply to Steve Prior.

I would rather say they are all very similar 🙂

public boolean add(E e) {
return offer(e);
}

Here’s the put method:
public void put(E e) {
offer(e);
}

And finally offer:
public boolean offer(E e) {
final ReentrantLock lock = this.lock;
lock.lock();
try {
q.offer(e);
if (q.peek() == e) {
leader = null;
available.signal();
}
return true;
} finally {
lock.unlock();
}
}

]]>