Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use ea-sync in spring boot #40

Closed
hufuman opened this issue Apr 12, 2019 · 3 comments
Closed

How to use ea-sync in spring boot #40

hufuman opened this issue Apr 12, 2019 · 3 comments
Labels

Comments

@hufuman
Copy link

hufuman commented Apr 12, 2019

Hi, thanks for great jobs!

I tried this in spring boot service, I found that await works like sync function to service, am I right ?

consider codes:

`

@ResponseBody()
@PostMapping("query.do")
public QueryResult query(@RequestParam int pageNum) {
    QueryResult result = new QueryResult(); <1>
    result.setResult(await(queryResult(pageNum))); <2>
    return result; <3>
}

`

In fact, this function only return after <2> queryResult is done?

@JoeHegarty
Copy link
Member

I'm not super familiar with spring boot, but is QueryResult derived from CompletionStage/CompletableFuture?
EA async instrumented methods must return and can only await on CompletionStage derived futures currently.

@hufuman
Copy link
Author

hufuman commented Apr 15, 2019

Thank JoeHegarty, I'll have a try.

@hufuman
Copy link
Author

hufuman commented Sep 6, 2019

It's ok, many thanks.

@hufuman hufuman closed this as completed Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants