konrad-kaminski / spring-kotlin-coroutine

Kotlin coroutine support for Spring.
448 stars 69 forks source link

the Java method #CoroutineUtils.runCoroutine doesn't work #46

Open cherrythefatbunny opened 5 years ago

cherrythefatbunny commented 5 years ago

I see the project has a java method named CoroutineUtils.runCoroutine,so in my opinion,i can run a coroutine in java.But i tried and it failed without invoking the continuation callback.Here is my code:


CoroutineUtils
                    .runCoroutine(context,
                            (scope, continuation) -> personMapperB.getName(name),
                            new Continuation<String>() {
                                @NotNull
                                @Override
                                public CoroutineContext getContext() {
                                    return context;
                                }

                                @Override
                                public void resumeWith(@NotNull Object o) {
                                    System.err.println(123445555);
                                }
                            });

So is it possible to invoke in java,if possible how can i do that?Thank you!!!