Performing a perspective script action after X period of time

I need an element to show on screen for a period of time, and then optionally "timeout" and disappear.

I have all of the functionality in place, and It was working great.

Essentially I used @pturmel's Later.py script module (placed into General.Later) to make it happen with:

def close_snack():
	self.custom.closeTrigger = True

timeout = int(value or 5000)
General.Later.invokeLater(close_snack, timeout)

However for some reason, that is no longer working and triggering the following exception in the logs:

Execution rejected... running in calling thread [perspective-worker-45091] immediately. [org.python.proxies.Later$_runnable$399@56f2181c]

This causes the action to perform immediately, instead of waiting 5 seconds.

I looked at my commit history to see if anything has changed in this script, and nothing has changed... Any ideas?

It means that the custom single-thread execution service that I create in gateway scope to emulate invokeLater is now broken. I'll have to investigate.

Update:

  • Its actually really intermittent... after a while, I tested it out by switching to using callAsyncDelayed and it was totally fine.
  • I have two different things leveraging this functionality at the same time? if thats possibly part of the cause?
  • I am in version 8.1.36

Maybe. It really is a single thread for the whole gateway.

UPDATE:

I modified the project so I just trigger it the one time, so I isolated it so that its only being called one time in the whole project, and when I trigger that instance it will still evaluate instantly (sometimes).

Version is 8.1.36 as well if that info helps.