> 9 maj 2014 kl. 19:33 skrev Heiko Seeberger <[email protected]>:
> 
> Maybe we could have `start` return an `ActorRef` immediately, i.e. an 
> asynchronous operation like `actorOf`?

I'm not sure it's worth the effort to implement something like 
RepointableActorRef for something that is called only at app startup (and is 
quick as is).

/Patrik
> 
> Heiko
> 
> 
> 
>> On Fri, May 9, 2014 at 4:48 PM, Patrik Nordwall <[email protected]> 
>> wrote:
>> 
>> 
>> 
>>> On Fri, May 9, 2014 at 4:43 PM, Jeroen Gordijn <[email protected]> 
>>> wrote:
>>> Thanks Patrik, I overlooked that it is blocking, that makes the fix even 
>>> easier. You mention that  you would not do it in the same place and I don't 
>>> have enough experience to comment on that, but in the course it seemed 
>>> perfectly valid to do just that. I created a ticket: 
>>> https://github.com/akka/akka/issues/15157
>> 
>> Thanks, yes, on second thought I agree. Pass it in to other actors.
>> /Patrik
>>  
>>> 
>>> Cheers,
>>> Jeroen
>>> 
>>> Op vrijdag 9 mei 2014 16:33:07 UTC+2 schreef Patrik Nordwall:
>>>> 
>>>> You should be able to do those calls immediately after each other, from 
>>>> same thread.
>>>> ClusterSharding(context.system).start
>>>> ClusterSharding(context.system).shardRegion
>>>> 
>>>> Start doesn't return until it has been initalized.
>>>> 
>>>> Normally, I don't think these two things are done at the same place in the 
>>>> code, so I don't think it is much value in returning the ActorRef from 
>>>> start, but it would not hurt to do so. Please create a ticket. Thanks for 
>>>> reporting.
>>>> 
>>>> Cheers,
>>>> Patrik
>>>> 
>>>> 
>>>>> On Fri, May 9, 2014 at 3:48 PM, Jeroen Gordijn <[email protected]> 
>>>>> wrote:
>>>>> Hi,
>>>>> 
>>>>> I followed the Advanced akka course in the last 2 days (which was awesome 
>>>>> by the way) and noticed something of the API which I think can be 
>>>>> improved. When you start the ClusterSharding its return type is Unit and 
>>>>> you have to retrieve the ShardRegion by calling the "shardRegion" on 
>>>>> ClusterSharding. However, this cannot take place in a short period, 
>>>>> because "shardRegion(...)" will 'throw new 
>>>>> IllegalArgumentException(s"Shard type [$typeName] must be started 
>>>>> first")'.
>>>>> 
>>>>> In my mind it would be an improvement if the start returns an ActorRef 
>>>>> immediately and then buffers all requests to it until the ShardRegion is 
>>>>> initialized. Am I overlooking some problems with that?
>>>>> 
>>>>> Cheers,
>>>>> Jeroen
>>>>> 
>>>>> -- Start ShardRegion
>>>>> ClusterSharding(context.system).start(
>>>>>     "player",
>>>>>     Some(Player.props),
>>>>>     Player.idExtractor,
>>>>>     Player.shardResolver(10)
>>>>>   )
>>>>> 
>>>>> -- get reference to ShardRegion
>>>>>   val playerRegion = ClusterSharding(context.system).shardRegion("player")
>>>>> -- 
>>>>> >>>>>>>>>> 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.
>>>> 
>>>> 
>>>> 
>>>> 
>>>> -- 
>>>> Patrik Nordwall
>>>> Typesafe -  Reactive apps on the JVM
>>>> Twitter: @patriknw
>>>> 
>>>> JOIN US. REGISTER TODAY!
>>>> Scala
>>>> Days
>>>> June 16th-18th,
>>>> Berlin
>>> 
>>> -- 
>>> >>>>>>>>>> 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.
>> 
>> 
>> 
>> 
>> -- 
>> Patrik Nordwall
>> Typesafe -  Reactive apps on the JVM
>> Twitter: @patriknw
>> 
>> JOIN US. REGISTER TODAY!
>> Scala
>> Days
>> June 16th-18th,
>> Berlin
>> -- 
>> >>>>>>>>>> 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.
> 
> 
> 
> -- 
> 
> Heiko Seeberger
> Twitter: @hseeberger
> Blog: blog.heikoseeberger.name
> -- 
> >>>>>>>>>> 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.

-- 
>>>>>>>>>>      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