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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

dispatchEvent() vs dispatchBackgroundEvent()

jasong
1-Newbie

dispatchEvent() vs dispatchBackgroundEvent()

I can't seem to find the difference between these two calls on Things (Java based extension package) in docs.

I ask because Event processing issues have been an issue with one of our customers servers and I want to make sure I understand the implications of both calls and how they relate to the event queue.

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
ttielebein
12-Amethyst
(To:jasong)

Hello, these methods apply to the dispatching of local, non-property events. dispatchEvent() is synchronous, meaning the calling method will wait until the event completes to proceed with the rest of the code, and dispatchBackgroundEvent() is asynchronous, meaning that the calling method will continue on while the event processes. Local property events are always handled synchronously to reduce the chances of causing deadlocks in the database.

I hope this helps!

Tori

View solution in original post

1 REPLY 1
ttielebein
12-Amethyst
(To:jasong)

Hello, these methods apply to the dispatching of local, non-property events. dispatchEvent() is synchronous, meaning the calling method will wait until the event completes to proceed with the rest of the code, and dispatchBackgroundEvent() is asynchronous, meaning that the calling method will continue on while the event processes. Local property events are always handled synchronously to reduce the chances of causing deadlocks in the database.

I hope this helps!

Tori

Top Tags