You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Sergei Egorov <bs...@gmail.com> on 2017/01/25 11:04:03 UTC

Asynchronous jobs (not the scheduling)

Hi all,

I'm wondering if it's possible not to block the job executor's thread when
I wait for some async event.

somethingLike:

```
ignite.compute().run(() -> someServiceRefSomehow.doSomethingAsync());
```

where
```
interface SomeService {
    CompletableFuture<String> doSomethingAsync();
}
```

Or even better:

```
interface SomeService {
    Observable<String> doSomethingAsync();
}
```

Thanks!

Re: Asynchronous jobs (not the scheduling)

Posted by Yakov Zhdanov <yz...@apache.org>.
Sergei, Vlad,

I think you also might be interested in compute continuations since the
result of async execution may be sufficient for the job itself. Please see
ComputeFibonacciContinuationExample under ignite/examples.

--Yakov

Re: Asynchronous jobs (not the scheduling)

Posted by Vladislav Pyatkov <vl...@gmail.com>.
Hi Sergei,

Why do you not use "ignite.compute().withAsync()"?

On Wed, Jan 25, 2017 at 2:04 PM, Sergei Egorov <bs...@gmail.com> wrote:

> Hi all,
>
> I'm wondering if it's possible not to block the job executor's thread when
> I wait for some async event.
>
> somethingLike:
>
> ```
> ignite.compute().run(() -> someServiceRefSomehow.doSomethingAsync());
> ```
>
> where
> ```
> interface SomeService {
>     CompletableFuture<String> doSomethingAsync();
> }
> ```
>
> Or even better:
>
> ```
> interface SomeService {
>     Observable<String> doSomethingAsync();
> }
> ```
>
> Thanks!
>



-- 
Vladislav Pyatkov