magicroomy
magicroomy

Reputation: 395

Use Hazelcast Executor Service to be executed on clients

I all the documentation and all the "Google search results" I saw, the hazelcast executor service can be used to be executed on "Members". I wonder if it is possible to also have things being executed on hazelcast clients?

Upvotes: 0

Views: 989

Answers (2)

wildnez
wildnez

Reputation: 1098

You can also create a Near Cache on client side and use JDK’s ExecutorService that runs in your local jvm app.

Upvotes: 1

Neil Stevenson
Neil Stevenson

Reputation: 3150

The distributed executor service is intended to run processing where the data is hosted, on the servers. This is a similar idea to a stored procedure, run the processing where the data lives, save data transfer.

In general, you can't run a Java Runnable or Callable on the clients as the clients may not be Java.

Also, the clients don't host any data, so they'd have to fetch what data they need from the servers potentially.

If you want something to run on all or some connected clients, you could implement this yourself using the publish/subscribe mechanism. A payload could be sent to an ITopic with the necessary execution parameters, and clients listening can act on the message.

Upvotes: 1

Related Questions