Hi,

I’m not sure if this is the exact cause, but I believe that “A reactor is 
created during onCreate(Bundle) and destroyed during onDestroy()” is not a 
good approach. I have tried this before, and found that killing an actor is 
a very slow operation. If the fragment is recreated fast enough, you may 
risk creating several duplicate actors.

In https://github.com/macroid/macroid-akka-fragments I have implemented a 
different strategy: actors are sticking around all the time, but can be in 
Attached and Detached states. When the fragment is created, it attaches 
itself to the actor by sending AttachUi(this), and when it’s destroyed, it 
sends DetachUi. You can find more details in the readme.

Unfortunately I don’t have any experience with akka-persistence, so I can’t 
give any further comments.

Nick

On Tuesday, June 24, 2014 10:55:24 AM UTC+1, Oscar Vargas Torres wrote:
>
> PLEASE, take a look at the README.md here
>
>
> https://github.com/oscarvarto/taskManager#where-i-want-to-go-not-yet-working
>
> The above repository contains code that (partially) works on Android, but 
> I need help for the Akka Persistence part.
>
> Here is one log showing that the FSMProcessor indeeds receives past 
> persisted messages. Still not what I want to get to (PLEASE TAKE A LOOK AT 
> THE README).
>
> 06-23 16:10:40.723    3085-3085/? D/Debug﹕ InitialAA#onCreate() called
> 06-23 16:10:41.294    3085-3172/? D/Debug﹕ InitialReactor#preStart() 
> called, before sendind FireUpAkkaLand
> 06-23 16:10:41.294    3085-3085/? D/Debug﹕ Fragment 
> InitialAAFragment{41ed7270 #0 id=0x3e9 initial} and 
> Actor[akka://Experiment/user/
> InitialAAReactor#1451667202] CREATED
> 06-23 16:10:41.304    3085-3175/? D/Debug﹕ LogonActivityActor#preStart() 
> called
> 06-23 16:10:41.324    3085-3173/? D/Debug﹕ FSMProcessor#preStart() called, 
> after calling self ! Recover
> 06-23 16:10:41.654    3085-3173/? D/Debug﹕ CreateThereActivity(class 
> com.optrak.experiment.LogonAA,/user/InitialAAReactor) received in 
> FSMProcessor
> 06-23 16:10:41.654    3085-3180/? D/Debug﹕ CreateThereActivity(class 
> com.optrak.experiment.LogonAA,/user/InitialAAReactor) received in 
> FSMProcessor
> 06-23 16:10:41.654    3085-3180/? D/Debug﹕ CreateThereActivity(class 
> com.optrak.experiment.LogonAA,/user/InitialAAReactor) received in 
> FSMProcessor
> 06-23 16:10:41.664    3085-3180/? D/Debug﹕ 
> Logon(UserData(,),/user/LogonActivityActor) received in FSMProcessor
> 06-23 16:10:41.664    3085-3173/? D/Debug﹕ StartSecondAA received in 
> FSMProcessor
> 06-23 16:10:41.674    3085-3180/? D/Debug﹕ CreateThereActivity(class 
> com.optrak.experiment.LogonAA,/user/InitialAAReactor) received in 
> FSMProcessor
> 06-23 16:10:41.674    3085-3175/? D/Debug﹕ Logon(UserData(oscar,[email protected] 
> <javascript:>),/user/LogonActivityActor) received in FSMProcessor
> 06-23 16:10:41.674    3085-3180/? D/Debug﹕ StartSecondAA received in 
> FSMProcessor
> 06-23 16:10:41.684    3085-3174/? D/Debug﹕ CreateThereActivity(class 
> com.optrak.experiment.LogonAA,/user/InitialAAReactor) received in 
> FSMProcessor
> 06-23 16:10:41.684    3085-3175/? D/Debug﹕ CreateThereActivity(class 
> com.optrak.experiment.LogonAA,/user/InitialAAReactor) received in 
> FSMProcessor
> 06-23 16:10:41.684    3085-3175/? D/Debug﹕ Logon(UserData(o,[email protected] 
> <javascript:>),/user/LogonActivityActor) received in FSMProcessor
> 06-23 16:10:41.684    3085-3175/? D/Debug﹕ StartSecondAA received in 
> FSMProcessor
> 06-23 16:10:41.694    3085-3174/? D/Debug﹕ CreateThereActivity(class 
> com.optrak.experiment.MoodAA,/user/LogonAAReactor) received in FSMProcessor
> 06-23 16:10:41.694    3085-3175/? D/Debug﹕ StartTaskListAA received in 
> FSMProcessor
> 06-23 16:10:41.694    3085-3175/? D/Debug﹕ CreateThereActivity(class 
> com.optrak.experiment.TaskListAA,/user/SecondAAReactor) received in 
> FSMProcessor
> 06-23 16:10:41.704    3085-3174/? D/Debug﹕ AppendTask(Task(4)) received in 
> FSMProcessor
> 06-23 16:10:41.704    3085-3174/? D/Debug﹕ CreateThereActivity(class 
> com.optrak.experiment.LogonAA,/user/InitialAAReactor) received in 
> FSMProcessor
> 06-23 16:10:41.714    3085-3174/? D/Debug﹕ CreateThereActivity(class 
> com.optrak.experiment.LogonAA,/user/InitialAAReactor) received in 
> FSMProcessor
> 06-23 16:10:41.714    3085-3174/? D/Debug﹕ Logon(UserData(oscar,
> [email protected] <javascript:>),/user/LogonActivityActor) received in 
> FSMProcessor
> 06-23 16:10:41.714    3085-3174/? D/Debug﹕ StartSecondAA received in 
> FSMProcessor
> 06-23 16:10:41.714    3085-3173/? D/Debug﹕ CreateThereActivity(class 
> com.optrak.experiment.MoodAA,/user/LogonAAReactor) received in FSMProcessor
> 06-23 16:10:41.714    3085-3175/? D/Debug﹕ StartTaskListAA received in 
> FSMProcessor
> 06-23 16:10:41.724    3085-3175/? D/Debug﹕ CreateThereActivity(class 
> com.optrak.experiment.TaskListAA,/user/SecondAAReactor) received in 
> FSMProcessor
> 06-23 16:10:41.724    3085-3175/? D/Debug﹕ CreateThereActivity(class 
> com.optrak.experiment.LogonAA,/user/InitialAAReactor) received in 
> FSMProcessor
> 06-23 16:10:41.724    3085-3175/? D/Debug﹕ Logon(UserData(oscqr,[email protected] 
> <javascript:>),/user/LogonActivityActor) received in FSMProcessor
> 06-23 16:10:41.724    3085-3175/? D/Debug﹕ StartSecondAA received in 
> FSMProcessor
> 06-23 16:10:41.724    3085-3175/? D/Debug﹕ CreateThereActivity(class 
> com.optrak.experiment.MoodAA,/user/LogonAAReactor) received in FSMProcessor
> 06-23 16:10:41.734    3085-3175/? D/Debug﹕ MakeMeSad received in 
> FSMProcessor
> 06-23 16:10:41.734    3085-3175/? D/Debug﹕ StartTaskListAA received in 
> FSMProcessor
> 06-23 16:10:41.734    3085-3175/? D/Debug﹕ CreateThereActivity(class 
> com.optrak.experiment.TaskListAA,/user/SecondAAReactor) received in 
> FSMProcessor
> 06-23 16:10:41.744    3085-3175/? D/Debug﹕ AppendTask(Task(4)) received in 
> FSMProcessor
> 06-23 16:10:41.744    3085-3173/? D/Debug﹕ CreateThereActivity(class 
> com.optrak.experiment.LogonAA,/user/InitialAAReactor) received in 
> FSMProcessor
> 06-23 16:10:41.744    3085-3175/? D/Debug﹕ CreateThereActivity(class 
> com.optrak.experiment.LogonAA,/user/InitialAAReactor) received in 
> FSMProcessor
> 06-23 16:10:41.774    3085-3173/? D/Debug﹕ CreateThereActivity(class 
> com.optrak.experiment.LogonAA,/user/InitialAAReactor) received in 
> FSMProcessor
> 06-23 16:10:41.774    3085-3175/? D/Debug﹕ InitialReactor received a 
> CreateThereActivity msg
> 06-23 16:10:41.804    3085-3085/? D/Debug﹕ Fragment LogonFragment{42535360 
> #0 id=0x3e9 logon} and 
> Actor[akka://Experiment/user/LogonAAReactor#-1115754166] CREATED
> 06-23 16:10:41.804    3085-3173/? D/Debug﹕ 
> Actor[akka://Experiment/user/LogonAAReactor#-1115754166]#preStart() called
> 06-23 16:10:41.804    3085-3175/? D/Debug﹕ LogonActivityActor received a 
> RequestInitialisation from 
> Actor[akka://Experiment/user/LogonAAReactor#-1115754166]
> 06-23 16:10:42.245    3085-3085/? D/Debug﹕ Fragment 
> InitialAAFragment{41ed7270 #0 id=0x3e9 initial} and 
> Actor[akka://Experiment/user/InitialAAReactor#1451667202] DESTROYED
>
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to