Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

some questions in Asynchronous

caiyunCheng December 6, 2020

I have a time-consuming operation,so I use Java1.8 asynchronous.  Like this :

function getSomeThing(){

    CompletableFuture<List<String>> list = CompletableFuture.supplyAsync(() ->{

         getList();    //task some seconds;  

    });

}

function getList(){

    ApplicationUser loggedUser = JiraAuthenticationContext.getLoggedInUser();

}

My question is that the above loggerUser will be null,  but I can get it if I don't user CompletableFuture,  I don't know why ?? 

If someone can help  ,  thank you so much !!!

1 answer

0 votes
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 10, 2020

Hello @caiyunCheng ,

Please notice that this might not be the best place to get help on development related questions. So, in case of no reply, I'd advise to refer to the resources listed in https://developer.atlassian.com/resources. 

Specifically:

 

Cheers,
Dario

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events