Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Kura » is CloudClient supports concurrency?(Multiple access CloudClient)
is CloudClient supports concurrency? [message #1725589] Fri, 04 March 2016 15:08 Go to next message
Said Ucar is currently offline Said UcarFriend
Messages: 56
Registered: June 2015
Member
Hi all,

In my project I have several Runnable class. In specific periods, this runnable objects publish some data to mqtt server. My questions;

1) What if 2 or more tasks try to use cloudClient what will be happened? (Does two messages will send or something else?)

2) As I said, I have several runnables. In Kura examples, runnables are in the Main class so this runnables use cloudClient and other services. I want to create Classes that implements Runnable interfaces. As you know, I intent to use cloudClient in my runnables. What is the proper way to carry my services to this runnable class? Should I define getter in Main class, or pass cloudClient as an argument to runnable class constructor or something else?

Thanks in advance,
Regards,
Said.
Re: is CloudClient supports concurrency? [message #1725713 is a reply to message #1725589] Mon, 07 March 2016 09:09 Go to previous messageGo to next message
Matteo Maiero is currently offline Matteo MaieroFriend
Messages: 423
Registered: July 2015
Location: Italy
Senior Member
Hi Said,
regarding point 1 I think that the different runnable in your bundle will share the same cloudClient handle. The publish method is composed by synchronized methods, so it should be no problem.
Regarding point 2, yes, you could pass the cloudClient as an argument of the class constructor.

Best regards,
Matteo
Re: is CloudClient supports concurrency? [message #1725888 is a reply to message #1725713] Tue, 08 March 2016 09:56 Go to previous message
Said Ucar is currently offline Said UcarFriend
Messages: 56
Registered: June 2015
Member
Hi Matteo,

I noticed that I will also need other services from the Main class and properties (comes from web ui). So I decided to pass
this
as an argument. So In my runnable classes, I have Main Class object and I can get whatever I need (services, properties etc.). I think this way is a little bit better.

Thank you for your answer,
Regards,
Said.
Previous Topic:missing clientId causes MQTT error, no web interface in local emulation
Next Topic:arp
Goto Forum:
  


Current Time: Tue Sep 24 09:56:41 GMT 2024

Powered by FUDForum. Page generated in 0.03573 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top