Skip to content

default implementation of @Backoff() should not use Thread.sleep #388

Open
@jonnytest1

Description

@jonnytest1

we used the @retryable annotation in a project recently and added a backoff of like one day to our decently long running job , due to the implementation with Thread.sleep this meant that no other scheduled jobs would trigger , which i tihnk isnt generally an expected behaviour , instead it should

  1. be dcoumented on @Retryableand its backoff property ,@backoff and its delay property (in all caps if need be) that this sleeps the Thread
  2. the default implementation should be
      TimerTask task = new TimerTask() {
        public void run() {
            System.out.println("Task performed on: " + new Date() + "n" +
              "Thread's name: " + Thread.currentThread().getName());
        }
    };
    Timer timer = new Timer("Timer");
    
    long delay = 1000L;
    timer.schedule(task, delay);
}

or another similar nonblocking implemenation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions