24 Kasım 2022 Perşembe

Jakarta EE Concurrency @MaxConcurrency

Örnek
Şöyle yaparız
//Limits through Semaphore the number of threads that can execute a method or all
//methods concurrently.
@ApplicationScoped
public class CDIBean {

  @MaxConcurrency(2
  public void maxTwoThreadsMethod(){};

  @MaxConcurrency(10
  public void maxUseofAPI(){}

}

Hiç yorum yok:

Yorum Gönder

Bean Validation @GroupSequence Anotasyonu

Örnek Elimizde şöyle bir kod olsun public class SampleRequest {   @NotNull   LocalDate startDate;   @NotNull   LocalDate endDate;   @AssertT...