activemq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ARTEMIS-1462) Allow ActiveMQScheduledComponent initial delay configuration
Date Fri, 13 Oct 2017 15:13:00 GMT

    [ https://issues.apache.org/jira/browse/ARTEMIS-1462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16203685#comment-16203685
] 

ASF GitHub Bot commented on ARTEMIS-1462:
-----------------------------------------

Github user clebertsuconic commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1586#discussion_r144581161
  
    --- Diff: artemis-commons/src/test/java/org/apache/activemq/artemis/utils/ActiveMQScheduledComponentTest.java
---
    @@ -165,4 +165,37 @@ public void run() {
           }
        }
     
    +   @Test
    +   public void testUsingCustomInitialDelay() throws InterruptedException {
    +      final CountDownLatch latch = new CountDownLatch(1);
    +      final long initialDelayMillis = 100;
    +      final long checkPeriodMillis = 100 * initialDelayMillis;
    +      final ActiveMQScheduledComponent local = new ActiveMQScheduledComponent(scheduledExecutorService,
executorService, initialDelayMillis, checkPeriodMillis, TimeUnit.MILLISECONDS, false) {
    +         @Override
    +         public void run() {
    +            latch.countDown();
    +         }
    +      };
    +      final long start = System.nanoTime();
    +      local.start();
    +      try {
    +         final boolean triggeredBeforePeriod = latch.await(local.getPeriod(), local.getTimeUnit());
    +         final long timeToFirstTrigger = TimeUnit.NANOSECONDS.convert(System.nanoTime()
- start, local.getTimeUnit());
    --- End diff --
    
    do you actually use NANOSECONDS on the Lock?


> Allow ActiveMQScheduledComponent initial delay configuration
> ------------------------------------------------------------
>
>                 Key: ARTEMIS-1462
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-1462
>             Project: ActiveMQ Artemis
>          Issue Type: Task
>          Components: Broker
>    Affects Versions: 2.3.0
>            Reporter: Francesco Nigro
>            Assignee: Francesco Nigro
>             Fix For: 2.4.0
>
>
> ActiveMQScheduledComponent currently support scheduling with a fixed period using the
period as the initial delay too: using different values could be helpful to support different
scenarios. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message