Can LiftActor be garbage collected before processing all scheduled messages?

15 views
Skip to first unread message

Mikhail Strebkov

unread,
May 21, 2013, 12:37:49 PM5/21/13
to lif...@googlegroups.com
Hi all,

In my Lift application I have code that looks like this (this is executed in response to ajax button click):

     if (someCondition) {   
        val actor = new MyLiftActor(someDependencies)
        actor ! DoLongRunningJob(arguments)
     }

someDependencies - unique for each session (they are stored in session state)
arguments - unique for each request (each button click)

I'm wondering if I use LiftActor correctly or there is a potential problem, since I don't store the reference to actor object anywhere.
Can it be garbage collected while processing my long running job?

Kind regards,
Mikhail

David Pollak

unread,
May 21, 2013, 2:22:09 PM5/21/13
to liftweb
The LiftActor cannot be GCed if it's running because the running thread will have a reference to the instance of the LiftActor. 


--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
 
---
You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Telegram, Simply Beautiful CMS https://telegr.am
Lift, the simply functional web framework http://liftweb.net

Mikhail Strebkov

unread,
May 21, 2013, 2:47:46 PM5/21/13
to lif...@googlegroups.com
Great! Thank you for the response.
Reply all
Reply to author
Forward
0 new messages