Scheduled Event Every Second

0
Is it possible to execute a scheduled event every second?   I have a microflow I would like to execute every second to obtain harmonic pattern data that changes frequently.   I see mendix is only able to execute scheduled events every minute. To bypass this restriction, I made multiple scheduled events that would be trigger every minute in a task queue, hoping to at least execute the same microflow every few seconds. With the thought that as the first scheduled event would finish, which would be less than a minute long, the second scheduled event would automatically be executed.  Hence the microflow would be executed every few seconds. But it didn't work.
asked
4 answers
1

Isn't there another solution to get the data you want? Even if you'd manage to trigger an API call every second, this would be killing for the performance of the application.

answered
0

Do you need this microflow to show data in your frontend? You could use a microflow timer widget instead: https://marketplace.mendix.com/link/component/27

answered
0

The Mendix Core API defines a method called scheduledAtFixedRate that you could probably use to trigger a microflow every second. However, as Jop says, this will probably be a significant performance hit.

https://apidocs.rnd.mendix.com/9/runtime/com/mendix/core/Core.html#scheduleAtFixedRate(java.lang.String,java.util.Date,long,java.util.concurrent.TimeUnit,java.lang.String,java.lang.String)

answered
0

Armandt did you find a solution?

My case
I have a legacy scheduled event, but want to migrate this one for the upgrade to Mx 10.

Possible solution
I was thinking about creating a microflow, that creates a new ‘call a microflow’-action which is added to the same task queue with a delay of a second using Delay function from CommunityCommons. This will delay the next start.

 

Would this be the best way to replace the Legacy Scheduled Event started every few seconds?

answered