cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

How to mark a service as asynchronous using the Edge SDKs?

brsmith
7-Bedrock

How to mark a service as asynchronous using the Edge SDKs?

We have some services that take some seconds to complete. I would like to be able to mark these services (that have no returne value) as being asynchronous and have them treated as such by calls from a Thingworx mashup. Is there a way to do this or are all services running on real devices (using the edge SDKs) considered to be synchronous?

Thanks - Brad

7 REPLIES 7

But by the way, you can implement it as asynchronous and send an event when it's done. For TW Asynchronous meas that it puts it's execution on a internal Queue, but it's not the case on a remote service, it doesn't makes any sense.

Why do you say it doesn't make any sense on a remote service?

I mean for TW platform, yes on the remote service it makes totally sense to have a Async service. But TW doesn't cares, it's not their responsibility to manage it's execution.

Perhaps my initial post could have been clearer. I don't want the Thingworx server platform to manage its execution, I want them to see that it's marked as asynchronous and to make the call on it and not wait for it to complete. Thingworx doesn't make the call directly on the implementation of the service, it goes through layers; remote services live inside classes that derive from VirtualThing and VirtualThing handles the service calls initially. I'm asking if there's a way to specify that a service is asynchronous and have VirtualThing process that invocation in an asynchronous way.

ttielebein
14-Alexandrite
(To:brsmith)

Which SDK are you using? Are you asking how to make things asynchronous within the SDK itself? That should involve syntax that exists independently of ThingWorx, no?

I'm using the C and Java SDKs but my question is for all APIs.Yes, I know how to do some work my end so that I'm not waiting for responses by using threads and queues etc. but my question was whether Thingworx had anything built in to handle this.

ttielebein
14-Alexandrite
(To:brsmith)

There is nothing built-in to the ThingWorx SDKs for async remote services as far as I know.

Announcements


Top Tags