[rules-users] please provide a rule for events timeout cases

Wolfgang Laun wolfgang.laun at gmail.com
Mon Apr 16 10:52:44 EDT 2012


See inline.

On 16/04/2012, skatta1986 <shivaprasad_gdk at yahoo.co.in> wrote:
> Hi, Thanks for the response..
>
> In general timer means executing a thread for every specified time period
> interval.

Why would you think so? java.util.Timer runs one thread, and
TimerTasks are executed by it, one after the other.

> But in our case, one time would be enough for an event. In the
> above rule my query is - after timeout case (i.e., firstime 10 seconds from
> the EventRequest), timer thread will be closed or will it be still running?

There's no point in disposing a Timer thread and to recreate it for
another activity. A dormant thread doesn't burden the system.


>
> Second Query is:
>
> Consider the below Success rule:
> rule event_success_case
>  when
>    EventRecord( type=EventRequest, id=1 )
>    and EventRecord( type=EventResponse, id=1 )
>
> With "no_response" rule, for every EventRequest there is a timer thread
> running for every 10Sec. Second rule "event_success_case" looks for its
> EventResponse. Suppose with in 10 seconds there is a response then
> "event_success_case" rule is run. Now I would like to close the timer thread
> because it uses my system memory. Please let me know if this is possible.

Trust Drools, trust Java. If the condition isn't true, everything will
be taken care of. (Threads don't use that much memory.)

-W

>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/please-provide-a-rule-for-events-timeout-cases-tp3907955p3914382.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



More information about the rules-users mailing list