Re: [akka-user] Pipe list of futures independently

2014-09-23 Thread Björn Antonsson
Hi Richard,

Your foreach will run through the list of Future[String] and on every single 
Future it will attach an onComplete block (this is what pipeTo does). The 
reason that this is ok is that you read the value of sender when you call the 
method pipeTo. If you on the other hand had written the onComplete code block 
yourself inside the foreach, the code would have been broken. That was the not 
so obvious thing I was referring to.

B/

On 22 September 2014 at 19:07:51, Richard Rodseth (rrods...@gmail.com) wrote:

I'm aware of the caveats about sender and closing over mutable state, but in 
this case the list was a plain list, not a Future. But thanks for showing an 
alternative.

On Mon, Sep 22, 2014 at 7:30 AM, Björn Antonsson bjorn.antons...@typesafe.com 
wrote:
Hi Richard,

When dealing with futures, inside actors you should generally be careful with 
using sender, since the code that is executed when the future is completed 
isn't run inside the actor and the meaning of sender might have changed. In 
this case, the pipeTo pattern will keep you safe, but it's easy to mess up.


If you don't plan to use the intermediate I would collapse the map and foreach 
into a single foreach.


val recipient = sender
requests.foreach { responseFuture = {
  responseFuture.map(response = ssuccess $response).recover({ case _ = 
failed}) pipeTo recipient
}}

B/

On 19 September 2014 at 20:46:50, Richard Rodseth (rrods...@gmail.com) wrote:

I'm still getting used to all the flavours of future composition. Fun stuff.  
Is there a better way than the following to pipe a list of futures to the 
sender (one message per future) ?

val requests:List[Future[SomeResponse]] = ...

val messages:List[Future[String]] = requests.map { responseFuture = {

  val msgFuture:Future[String] = responseFuture.map(response = ssuccess 
$response).recover { case _ = failed}

  msgFuture

}}

messages.foreach { msg =

  msg pipeTo sender

}
--
 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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

-- 
Björn Antonsson
Typesafe – Reactive Apps on the JVM
twitter: @bantonsson

--
 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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

-- 
Björn Antonsson
Typesafe – Reactive Apps on the JVM
twitter: @bantonsson

-- 
  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Sending mail from Camel

2014-09-23 Thread Björn Antonsson
Hi Zlaja,

I don't know enough about the Camel threading model to say a definite yes. It 
might be that the actual sending of the email is handled on another thread by 
Camel already.

If it's just this single actor and you're afraid that it might block other 
actors from executing, then I see no harm in moving it to a 
PinnedDispatcher. The Akka Camel Producer will create a child actor and this is 
probably the one that should be on the PinnedDispatcher.

B/

On 20 September 2014 at 09:18:25, Zlatko Josic (zlatko.jo...@gmail.com) wrote:

Hi,

I'am using Camel support for sending emails, I have an email actor. Should this 
actor be in separate executor which is used only for that or not? 


Zlaja
--
 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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

-- 
Björn Antonsson
Typesafe – Reactive Apps on the JVM
twitter: @bantonsson

-- 
  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] PersistentActor initialization best practices

2014-09-23 Thread sinel
 

Hi,

Even though it has been about a month since the last comment in this 
thread, I will add my question here since I think it is a direct 
continuation of this discussion.

I want to follow up on Jeroen’s comment. I am facing the same problem of 
figuring out how pass instance-specific props to my persistent actor using 
cluster sharding. I understand the solution of initializing it with a 
command, and this would work in the situation of the given AuctionActor 
example where secondary properties are set, but how about the situation 
where you would like to set an instance-specific persistence id?

In my case, I am trying to implement a domain actor representing an entity 
with its own unique identifier. I would like to use the same identifier for 
persistence (or a hybrid including the entity id) so that I can easily 
trace events related to this actor in the event logs and conveniently 
reclaim the actor through the entity id which I would always know.

While using persistence without cluster sharding, passing an identifier via 
props and assigning it to persistence id worked fine. However, with cluster 
sharding, I admit I am confused on how to implement this functionality. 
Using an initialize command won’t work, since I cannot change the 
persistence id after the fact.

I have looked at the akka-cluster-sharding template with its post example, 
but this hasn’t cleared my confusion. 

a) It looks like separate ids are used for the post entity vs persistence, 
but I assume that this is just a preference of the template and not a 
requirement. Since the id extractor recovers the post id, how does the 
cluster know which persistent actor to use? Looking at the code, the 
persistence id is totally different and I cannot see how the persistence id 
would be retrieved from the post id, which is a uuid in the test spec.

b) I also cannot see how the persistence id generated by the combination of 
self.path.parent.name and self.path.name can be unique for each post actor. 
Wouldn’t the parent be the same for most if not all requests? On the other 
hand, if there is a single post actor serving all incoming requests, I 
admit I cannot understand the become logic within the actor since it looks 
like it would accept only one AddPost command. How does it handle 
concurrent add post requests?

c) Whichever way sharding is managing this internally, I cannot see how I 
could reclaim a post actor outside of sharding. For example, if I would 
want to unit test the post actor and I would want to check that it recovers 
its state probably. Thus I would create an instance, then delete it, but 
how can I then reclaim the same actor to test recovery?

Most probably, I am missing something fundamental regarding how persistent 
actors are supposed to be used with sharding, and the template hasn’t 
helped clear my confusion. Any help/guidance would be greatly appreciated.

Thanks,

Sinan

On Tuesday, August 19, 2014 12:01:04 AM UTC+3, Jeroen Gordijn wrote:

 Hi,

 I guess that a downside of 3 is that it makes it less suitable to use in 
 ClusterSharding (in ClusterSharding you cannot pass instance specific props 
 to an actor).

 So my preference (especially with domain actors) is to create the actor 
 and initialize it with a command. All domain aggregates should react to 
 commands, so initializing with an event makes the design more consistent 
 IMHO.

 Cheers,
 Jeroen



-- 
  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Unexpected Terminate messages

2014-09-23 Thread Björn Antonsson
Hi Hamilton,

The Terminate message is an internal system message that gets sent to the actor 
when the internal method stop() is called, and you are right that you don't 
have to be worried about the messages. There are several ways that you can get 
multiple Terminated messages when you do an unordered shutdown, and one 
likely candidate is that you have actors trying to stop other actors that are 
not their own children, in which case there is a race between the parent actor 
stoping and the side actor stoping the child.

B/

On 22 September 2014 at 16:05:12, Hamilton Turner (hamilt...@gmail.com) wrote:

Hey all, 

At some point in my application I call system.shutdown() to turn everything 
off. In many of my actors this causes a Terminate message from an actor to 
itself (e.g. [INFO] [09/22/2014 09:40:36.984] 
[clasp-akka.actor.default-dispatcher-18] [akka://clasp/user/emanager] Message 
[akka.dispatch.sysmsg.Terminate] from 
Actor[akka://clasp/user/emanager#374263276] to 
Actor[akka://clasp/user/emanager#374263276] was not delivered. [2] dead letters 
encountered. This logging can be turned off or adjusted with configuration 
settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.) 
This Actor doesn't have much more than a receive, although I did override 
postStop to debug this - the Terminate message error is shown after postStop is 
called (although that could just be threading confusion). 

I'm curious where these messages come from - does the Akka core cause this to 
happen? If not, what might be triggering these Terminate messages - it the 
Actor calling stop on itself somewhere and the stop method is doing something 
like sending that actor a Terminate message? I'm not worried about these 
messages, just curious why they are happening

Any insight appreciated!

Thanks, 

Hamilton



PS - also see https://groups.google.com/forum/#!topic/akka-user/AU9QZ5uAfF0



--
 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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

-- 
Björn Antonsson
Typesafe – Reactive Apps on the JVM
twitter: @bantonsson

-- 
  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Critical Understanding Behavior Of PersistentView :Event Sourcing

2014-09-23 Thread Prakhyat Mallikarjun
Team,

I am not able to thoroughly understand Behavior Of PersistentView . I have 
below queries,

1. How does PersistentView works?
2. How does it maintain sequence number of events?
3. How does snapshot of PersistentView  works?
4. While recovery of PersistentView, will all the events replayed? 
5. Consider PersistentView  has to pull 8 events from Journal. It pulls 5 
events and fails. When it recovers, will it start pulling from 1st or 5th 
event? 
6. What should be the behavior of PersistentView in case of exception in 
receive method? 

-Prakhyat M M
 

-- 
  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Help with Akka persistence and dead letters

2014-09-23 Thread matteo
Hi, I'm trying to write a resilient photo uploading system using Akka 
persistence, but I'm having some issues.

I have a supervisor called *PhotoUploadSupervisor* that spawns a child 
actor when I need to upload a photo.

class PhotoUploadSupervisor extends Actor with ActorLogging {

  import context._

  def newChild = actorOf(Props[PhotoUploadActor])

  override val supervisorStrategy =
OneForOneStrategy(maxNrOfRetries = 10, withinTimeRange = 1 minute) {
  case _: IOException = Restart
  case _ = Escalate
}

  def receive = {
case postPhoto: POSTPhoto = newChild ! UploadPhoto(postPhoto)
  }

}

*POSTPhoto *is a simple case class:

case class POSTPhoto(
blob: String,
) {

  require(blob.nonEmpty)

}

This is the actor:

sealed trait Command
case class UploadPhoto(data: POSTPhoto) extends Command

sealed trait Event
case class StateChanged(data: POSTPhoto) extends Event

class PhotoUploadActor extends PersistentActor with ActorLogging {

  override def persistenceId = photoUploadActor

  var state = POSTPhoto(fakeBlob)

  def updateState(evt: StateChanged) = {
state = POSTPhoto(evt.data.blob)
  }

  val receiveRecover: Receive = {
case evt: StateChanged =
  updateState(evt)
  uploadToS3()
  }

  val receiveCommand: Receive = {

case UploadPhoto(data) =
  persist(StateChanged(data)) { changed =
updateState(changed)
uploadToS3()
  }

  }

  private def uploadToS3() = {

println(fUploading photo in actor ${self.path})

/*Photo upload code goes here*/
/*It might throw an IOException*/

context.stop(self)

  }

}

I want the actor to upload the photo and then stop.
The supervisor should spawn one child per photo upload request.

It looks like it's working, but I get a bunch of dead letters:

[INFO] [09/23/2014 13:33:21.587] 
[on-spray-can-akka.actor.default-dispatcher-2] 
[akka://on-spray-can/user/$a/$a] Message 
[akka.persistence.JournalProtocol$ReplayedMessage] from 
Actor[akka://on-spray-can/user/$a#-494389522] to 
Actor[akka://on-spray-can/user/$a/$a#1751213071] was not delivered. [1] 
dead letters encountered. This logging can be turned off or adjusted with 
configuration settings 'akka.log-dead-letters' and 
'akka.log-dead-letters-during-shutdown'.
[INFO] [09/23/2014 13:33:21.587] 
[on-spray-can-akka.actor.default-dispatcher-2] 
[akka://on-spray-can/user/$a/$a] Message 
[akka.persistence.JournalProtocol$ReplayedMessage] from 
Actor[akka://on-spray-can/user/$a#-494389522] to 
Actor[akka://on-spray-can/user/$a/$a#1751213071] was not delivered. [2] 
dead letters encountered. This logging can be turned off or adjusted with 
configuration settings 'akka.log-dead-letters' and 
'akka.log-dead-letters-during-shutdown'.
[INFO] [09/23/2014 13:33:21.587] 
[on-spray-can-akka.actor.default-dispatcher-2] 
[akka://on-spray-can/user/$a/$a] Message 
[akka.persistence.JournalProtocol$ReplayedMessage] from 
Actor[akka://on-spray-can/user/$a#644188776] to 
Actor[akka://on-spray-can/user/$a/$a#1751213071] was not delivered. [3] 
dead letters encountered. This logging can be turned off or adjusted with 
configuration settings 'akka.log-dead-letters' and 
'akka.log-dead-letters-during-shutdown'.
[INFO] [09/23/2014 13:33:21.587] 
[on-spray-can-akka.actor.default-dispatcher-2] 
[akka://on-spray-can/user/$a/$a] Message 
[akka.persistence.JournalProtocol$ReplayedMessage] from 
Actor[akka://on-spray-can/user/$a#1549609203] to 
Actor[akka://on-spray-can/user/$a/$a#1751213071] was not delivered. [4] 
dead letters encountered. This logging can be turned off or adjusted with 
configuration settings 'akka.log-dead-letters' and 
'akka.log-dead-letters-during-shutdown'.
[INFO] [09/23/2014 13:33:21.587] 
[on-spray-can-akka.actor.default-dispatcher-2] 
[akka://on-spray-can/user/$a/$a] Message 
[akka.persistence.JournalProtocol$ReplayedMessage] from 
Actor[akka://on-spray-can/user/$a#1549609203] to 
Actor[akka://on-spray-can/user/$a/$a#1751213071] was not delivered. [5] 
dead letters encountered. This logging can be turned off or adjusted with 
configuration settings 'akka.log-dead-letters' and 
'akka.log-dead-letters-during-shutdown'.
[INFO] [09/23/2014 13:33:21.587] 
[on-spray-can-akka.actor.default-dispatcher-2] 
[akka://on-spray-can/user/$a/$a] Message 
[akka.persistence.JournalProtocol$ReplayMessagesSuccess$] from 
Actor[akka://on-spray-can/system/journal#-343657892] to 
Actor[akka://on-spray-can/user/$a/$a#1751213071] was not delivered. [6] 
dead letters encountered. This logging can be turned off or adjusted with 
configuration settings 'akka.log-dead-letters' and 
'akka.log-dead-letters-during-shutdown'.

Messages ReplayedMessage and ReplayedMessagesSuccess can't be delivered 
apparently!

Is that an issue or not?

Thanks!

M.



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

[akka-user] Re: Problema de configuração para cluster

2014-09-23 Thread Tiago Canatelli
Thanks a help, the problem is solution

Em sexta-feira, 19 de setembro de 2014 08h59min17s UTC-3, Tiago Canatelli 
escreveu:

 Bom dia pessoal,

 estou iniciando no desenvolvimento Akka, estou tendo que resolver um 
 problema aqui na empresa para uma solução akka para fazer um teste, porem 
 ao inicializar no servelt context listener, estou tendo o seguinte erro 
 abaixo (Alguém pode me ajudar nessa configuração?): 

 Erro está dando nesse método:
 private Address startBackend(final Address joinAddress, final String role, 
 final String resultsTopic) {
 * NESSA LINHA*  * final Address realJoinAddress = (joinAddress == 
 null) ? Cluster.get(actorSystem).selfAddress() : joinAddress;*
 Cluster.get(actorSystem).join(realJoinAddress);

 // Create the master actor
 actorSystem.actorOf(getDefaultMasterProps(role, resultsTopic), 
 Constants.MASTER);

 return realJoinAddress;
 }

 Segue meu arquivo de configuração como está (application.conf):
 akka {
 actor {
 provider = akka.cluster.ClusterActorRefProvider
 }
 remote {
 transport = akka.remote.netty.NettyRemoteTransport
 log-remote-lifecycle-events = off
 netty {
 hostname = totvs-00074
 port = 0
 }
 }

 cluster {
 seed-nodes = [
 akka://Workers@TOTVS-00074:2551,
 akka://Workers@TOTVS-00074:2552]
 auto-down = on
 } 
 }




 [ERROR   ] SRVE0283E: Exception caught while initializing context: 
 akka.ConfigurationException: ActorSystem [akka://Workers] needs to have a 
 'ClusterActorRefProvider' enabled in the configuration, currently uses 
 [akka.actor.LocalActorRefProvider]
 at akka.cluster.Cluster.init(Cluster.scala:79)
 at akka.cluster.Cluster$.createExtension(Cluster.scala:42)
 at akka.cluster.Cluster$.createExtension(Cluster.scala:37)
 at akka.actor.ActorSystemImpl.registerExtension(ActorSystem.scala:711)
 at akka.actor.ExtensionId$class.apply(Extension.scala:79)
 at akka.cluster.Cluster$.apply(Cluster.scala:37)
 at akka.actor.ExtensionId$class.get(Extension.scala:91)
 at akka.cluster.Cluster$.get(Cluster.scala:38)
 at akka.cluster.Cluster.get(Cluster.scala)
 at 
 worker.calculator.BackendNodeStarter.startBackend(BackendNodeStarter.java:46)
 at 
 worker.calculator.BackendNodeStarter.startupNode(BackendNodeStarter.java:29)
 at 
 worker.calculator.ClusterNodeStarter.startup(ClusterNodeStarter.java:57)
 at 
 br.com.totvs.tfs.fees.web.servlet.AkkaServletContextListener.contextInitialized(AkkaServletContextListener.java:26)
 at 
 com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:2228)
 at [internal classes]



-- 
  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Problem with master node in akka with scala

2014-09-23 Thread Tiago Canatelli
good morning,

i need a help with the code below, the method return a notok message, but i 
need it returns a ok message, but i don't know scala, how i can rersolve 
this or what causes this problem?

class Frontend extends Actor {
  import Frontend._
  import context.dispatcher

  val masterProxy = context.actorOf(ClusterSingletonProxy.props(
singletonPath = Constants.ACTIVE_MASTER,
role = Some(Constants.BACKEND)),
name = Constants.MASTER_PROXY)

  def receive = {
case work =
  implicit val timeout = Timeout(Constants.WORK_TIMEOUT)
  (masterProxy ? work) map {
case Master.Ack(_) = Ok *(I need the message return this ok, but 
not knows the masternode)*
  } recover { case _ = NotOk } pipeTo sender()
  }
}

my application.conf:

# In this file you can override any option defined in the reference files.
# Copy in parts of the reference files and modify as you please.

akka {

  # Loggers to register at boot time (akka.event.Logging$DefaultLogger logs
  # to STDOUT)
  loggers = [akka.event.slf4j.Slf4jLogger]

  # Loggers are created and registered synchronously during ActorSystem
  # start-up, and since they are actors, this timeout is used to bound the
  # waiting time
  logger-startup-timeout = 5s

  # Log level used by the configured loggers (see loggers) as soon
  # as they have been started; before that, see stdout-loglevel
  # Options: OFF, ERROR, WARNING, INFO, DEBUG
  loglevel = DEBUG

  # Log level for the very basic logger activated during ActorSystem 
startup.
  # This logger prints the log messages to stdout (System.out).
  # Options: OFF, ERROR, WARNING, INFO, DEBUG
  stdout-loglevel = WARNING

  actor {
# FQCN of the ActorRefProvider to be used; the below is the built-in 
default,
# another one is akka.remote.RemoteActorRefProvider in the akka-remote 
bundle.
provider = akka.cluster.ClusterActorRefProvider
  }

  remote {
# If this is on, Akka will log all inbound messages at DEBUG level,
# if off then they are not logged
log-received-messages = off

# If this is on, Akka will log all outbound messages at DEBUG level,
# if off then they are not logged
log-sent-messages = off

# Sets the log granularity level at which Akka logs remoting events. 
This setting
# can take the values OFF, ERROR, WARNING, INFO, DEBUG, or ON. For 
compatibility
# reasons the setting on will default to debug level. Please note 
that the effective
# logging level is still determined by the global logging level of the 
actor system:
# for example debug level remoting events will be only logged if the 
system
# is running with debug level logging.
# Failures to deserialize received messages also fall under this flag.
log-remote-lifecycle-events = off

# Logging of message types with payload size in bytes larger than
# this value. Maximum detected size per message type is logged once,
# with an increase threshold of 10%.
# By default this feature is turned off. Activate it by setting the 
property to
# a value in bytes, such as 1000b. Note that for all messages larger 
than this
# limit there will be extra performance and scalability cost.
log-frame-size-exceeding = off

# Log warning if the number of messages in the backoff buffer in the 
endpoint
# writer exceeds this limit. It can be disabled by setting the value to 
off.
log-buffer-size-exceeding = 5

enabled-transports = [akka.remote.netty.tcp]

netty.tcp {
  hostname = 127.0.0.1

  # The port clients should connect to. Default is 2552.
  port = 0
}
  }

  cluster {

# Should the 'leader' in the cluster be allowed to automatically mark
# unreachable nodes as DOWN after a configured time of unreachability?
# Using auto-down implies that two separate clusters will automatically 
be
# formed in case of network partition.
# Disable with off or specify a duration to enable auto-down.
auto-down-unreachable-after = 10s

role {
  # Minimum required number of members of a certain role before the 
leader
  # changes member status of 'Joining' members to 'Up'. Typically used 
together
  # with 'Cluster.registerOnMemberUp' to defer some action, such as 
starting
  # actors, until the cluster has reached a certain size.
  worker.min-nr-of-members = 1
  backend.min-nr-of-members = 1
}
  }

  # List FQCN of extensions which shall be loaded at actor system startup.
  # Should be on the format: 'extensions = [foo, bar]' etc.
  # See the Akka Documentation for more info about Extensions
  extensions = [
akka.contrib.pattern.ClusterReceptionistExtension
  ]
}

# Default thread dispatcher adjustment for underpowered machines
akka.actor.default-dispatcher {

  # This will be used if you have set executor = fork-join-executor
  fork-join-executor {
# Min number of threads to cap factor-based parallelism number to
parallelism-min = 4

# Max number of 

[akka-user] combining receive pfs - am I being stupid here?

2014-09-23 Thread Tim Pigden
The following example:

class TestPF extends Actor {

  val x: Receive = {
case hi = sender ! hello
  }

  val y: Receive = {
case bye = sender ! farewell
  }

  def receive = { x orElse y }

}

gets a warning
Warning:(18, 28) a type was inferred to be `Any`; this may indicate a 
programming error.
  def receive = { x orElse y }
   ^

Am I doing something wrong? I thought this was the intended use pattern. 
Can I make these warnings go away?

-- 
  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] combining receive pfs - am I being stupid here?

2014-09-23 Thread Alec Zorab
My workaround:

..in package object ...
  def Rx(r: Receive): Receive = r

//no warnings!
class Act extends Actor {
  val x: Receive = Rx {
case hi = sender ! hello
  }

  val y: Receive = Rx {
case bye = sender ! farewell
  }

  def receive = Rx {x orElse y}
}

On 23 September 2014 17:29, Tim Pigden tim.pig...@optrak.com wrote:

 The following example:

 class TestPF extends Actor {

   val x: Receive = {
 case hi = sender ! hello
   }

   val y: Receive = {
 case bye = sender ! farewell
   }

   def receive = { x orElse y }

 }

 gets a warning
 Warning:(18, 28) a type was inferred to be `Any`; this may indicate a
 programming error.
   def receive = { x orElse y }
^

 Am I doing something wrong? I thought this was the intended use pattern.
 Can I make these warnings go away?

 --
  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 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Pipe list of futures independently

2014-09-23 Thread Richard Rodseth
Got it. Thanks!

On Mon, Sep 22, 2014 at 11:32 PM, Björn Antonsson 
bjorn.antons...@typesafe.com wrote:

 Hi Richard,

 Your foreach will run through the list of Future[String] and on every
 single Future it will attach an onComplete block (this is what pipeTo
 does). The reason that this is ok is that you read the value of sender when
 you call the method pipeTo. If you on the other hand had written the
 onComplete code block yourself inside the foreach, the code would have been
 broken. That was the not so obvious thing I was referring to.

 B/

 On 22 September 2014 at 19:07:51, Richard Rodseth (rrods...@gmail.com)
 wrote:

 I'm aware of the caveats about sender and closing over mutable state, but
 in this case the list was a plain list, not a Future. But thanks for
 showing an alternative.

 On Mon, Sep 22, 2014 at 7:30 AM, Björn Antonsson 
 bjorn.antons...@typesafe.com wrote:

  Hi Richard,

 When dealing with futures, inside actors you should generally be careful
 with using sender, since the code that is executed when the future is
 completed isn't run inside the actor and the meaning of sender might have
 changed. In this case, the pipeTo pattern will keep you safe, but it's easy
 to mess up.


 If you don't plan to use the intermediate I would collapse the map and
 foreach into a single foreach.


 val recipient = sender
 requests.foreach { responseFuture = {
   responseFuture.map(response = ssuccess $response).recover({ case _
 = failed}) pipeTo recipient
 }}

 B/

 On 19 September 2014 at 20:46:50, Richard Rodseth (rrods...@gmail.com)
 wrote:

   I'm still getting used to all the flavours of future composition. Fun
 stuff.  Is there a better way than the following to pipe a list of futures
 to the sender (one message per future) ?

 val requests:List[Future[SomeResponse]] = ...

 val messages:List[Future[String]] = requests.map { responseFuture = {

   val msgFuture:Future[String] = responseFuture.map(response =
 ssuccess $response).recover { case _ = failed}

   msgFuture

 }}

 messages.foreach { msg =

   msg pipeTo sender

 }
   --
  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 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.


 --
 Björn Antonsson
 Typesafe http://typesafe.com/ – Reactive Apps on the JVM
  twitter: @bantonsson http://twitter.com/#!/bantonsson

   --
  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 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 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 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.


 --
 Björn Antonsson
 Typesafe http://typesafe.com/ – Reactive Apps on the JVM
 twitter: @bantonsson http://twitter.com/#!/bantonsson

  --
  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 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 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 

[akka-user] Unbinding a StreamTcp server binding

2014-09-23 Thread Chris Baxter
I can't currently find a way to perform an Unbind with a StreamTcp server 
binding.  What if for some reason I no longer want to be connected to that 
socket.  The regular Tcp binding has a way to do this (by sending an Unbind 
to whoever responded to the original Bind request), but I don't see this 
same system in place for StreamTcp.  Am I missing something?

-- 
  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] PersistentActor initialization best practices

2014-09-23 Thread Jeroen Gordijn
Hi Sinan,

The name of the actor that is created in the cluster is stable and can be 
used as persistenceId, In the Example the name of parent concatenated with 
the entityId is used. You could as wel create the id yourself like: 

   1. def persistenceId = orders- + self.path.name
   

This way you know the persistenceId and you re-create the actor in the same 
way as you had created it in the first place.

HTH
Cheers,
Jeroen


Op dinsdag 23 september 2014 09:26:52 UTC+2 schreef sinel:

 Hi,

 Even though it has been about a month since the last comment in this 
 thread, I will add my question here since I think it is a direct 
 continuation of this discussion.

 I want to follow up on Jeroen’s comment. I am facing the same problem of 
 figuring out how pass instance-specific props to my persistent actor using 
 cluster sharding. I understand the solution of initializing it with a 
 command, and this would work in the situation of the given AuctionActor 
 example where secondary properties are set, but how about the situation 
 where you would like to set an instance-specific persistence id?

 In my case, I am trying to implement a domain actor representing an entity 
 with its own unique identifier. I would like to use the same identifier for 
 persistence (or a hybrid including the entity id) so that I can easily 
 trace events related to this actor in the event logs and conveniently 
 reclaim the actor through the entity id which I would always know.

 While using persistence without cluster sharding, passing an identifier 
 via props and assigning it to persistence id worked fine. However, with 
 cluster sharding, I admit I am confused on how to implement this 
 functionality. Using an initialize command won’t work, since I cannot 
 change the persistence id after the fact.

 I have looked at the akka-cluster-sharding template with its post example, 
 but this hasn’t cleared my confusion. 

 a) It looks like separate ids are used for the post entity vs persistence, 
 but I assume that this is just a preference of the template and not a 
 requirement. Since the id extractor recovers the post id, how does the 
 cluster know which persistent actor to use? Looking at the code, the 
 persistence id is totally different and I cannot see how the persistence id 
 would be retrieved from the post id, which is a uuid in the test spec.

 b) I also cannot see how the persistence id generated by the combination 
 of self.path.parent.name and self.path.name can be unique for each post 
 actor. Wouldn’t the parent be the same for most if not all requests? On the 
 other hand, if there is a single post actor serving all incoming requests, 
 I admit I cannot understand the become logic within the actor since it 
 looks like it would accept only one AddPost command. How does it handle 
 concurrent add post requests?

 c) Whichever way sharding is managing this internally, I cannot see how I 
 could reclaim a post actor outside of sharding. For example, if I would 
 want to unit test the post actor and I would want to check that it recovers 
 its state probably. Thus I would create an instance, then delete it, but 
 how can I then reclaim the same actor to test recovery?

 Most probably, I am missing something fundamental regarding how persistent 
 actors are supposed to be used with sharding, and the template hasn’t 
 helped clear my confusion. Any help/guidance would be greatly appreciated.

 Thanks,

 Sinan

 On Tuesday, August 19, 2014 12:01:04 AM UTC+3, Jeroen Gordijn wrote:

 Hi,

 I guess that a downside of 3 is that it makes it less suitable to use in 
 ClusterSharding (in ClusterSharding you cannot pass instance specific props 
 to an actor).

 So my preference (especially with domain actors) is to create the actor 
 and initialize it with a command. All domain aggregates should react to 
 commands, so initializing with an event makes the design more consistent 
 IMHO.

 Cheers,
 Jeroen



-- 
  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Help with Akka persistence and dead letters

2014-09-23 Thread Jeroen Gordijn
Hi M.,

Your persistenceId should be unique per request or per photo. There should 
only be one instance of an actor holding the same persistenceId. Otherwise 
there are multiple threads writing and reading from the same store. Every 
time you instantiate a new actor it will replay the journal and resend the 
first photo. After that, the actor stops and all other messages go to dead 
letters.

What are your requirements? What do you want to make resilient. Your 
current direction you're heading won't make it resilient, but it will store 
every request you receive.

BTW: receiveRecover should have no side effects. You are sending to S3 on 
every recovery.


Cheers,
Jeroen

Op dinsdag 23 september 2014 14:37:04 UTC+2 schreef mat...@wondr.it:

 Hi, I'm trying to write a resilient photo uploading system using Akka 
 persistence, but I'm having some issues.

 I have a supervisor called *PhotoUploadSupervisor* that spawns a child 
 actor when I need to upload a photo.

 class PhotoUploadSupervisor extends Actor with ActorLogging {

   import context._

   def newChild = actorOf(Props[PhotoUploadActor])

   override val supervisorStrategy =
 OneForOneStrategy(maxNrOfRetries = 10, withinTimeRange = 1 minute) {
   case _: IOException = Restart
   case _ = Escalate
 }

   def receive = {
 case postPhoto: POSTPhoto = newChild ! UploadPhoto(postPhoto)
   }

 }

 *POSTPhoto *is a simple case class:

 case class POSTPhoto(
 blob: String,
 ) {

   require(blob.nonEmpty)

 }

 This is the actor:

 sealed trait Command
 case class UploadPhoto(data: POSTPhoto) extends Command

 sealed trait Event
 case class StateChanged(data: POSTPhoto) extends Event

 class PhotoUploadActor extends PersistentActor with ActorLogging {

   override def persistenceId = photoUploadActor

   var state = POSTPhoto(fakeBlob)

   def updateState(evt: StateChanged) = {
 state = POSTPhoto(evt.data.blob)
   }

   val receiveRecover: Receive = {
 case evt: StateChanged =
   updateState(evt)
   uploadToS3()
   }

   val receiveCommand: Receive = {

 case UploadPhoto(data) =
   persist(StateChanged(data)) { changed =
 updateState(changed)
 uploadToS3()
   }

   }

   private def uploadToS3() = {

 println(fUploading photo in actor ${self.path})

 /*Photo upload code goes here*/
 /*It might throw an IOException*/

 context.stop(self)

   }

 }

 I want the actor to upload the photo and then stop.
 The supervisor should spawn one child per photo upload request.

 It looks like it's working, but I get a bunch of dead letters:

 [INFO] [09/23/2014 13:33:21.587] 
 [on-spray-can-akka.actor.default-dispatcher-2] 
 [akka://on-spray-can/user/$a/$a] Message 
 [akka.persistence.JournalProtocol$ReplayedMessage] from 
 Actor[akka://on-spray-can/user/$a#-494389522] to 
 Actor[akka://on-spray-can/user/$a/$a#1751213071] was not delivered. [1] 
 dead letters encountered. This logging can be turned off or adjusted with 
 configuration settings 'akka.log-dead-letters' and 
 'akka.log-dead-letters-during-shutdown'.
 [INFO] [09/23/2014 13:33:21.587] 
 [on-spray-can-akka.actor.default-dispatcher-2] 
 [akka://on-spray-can/user/$a/$a] Message 
 [akka.persistence.JournalProtocol$ReplayedMessage] from 
 Actor[akka://on-spray-can/user/$a#-494389522] to 
 Actor[akka://on-spray-can/user/$a/$a#1751213071] was not delivered. [2] 
 dead letters encountered. This logging can be turned off or adjusted with 
 configuration settings 'akka.log-dead-letters' and 
 'akka.log-dead-letters-during-shutdown'.
 [INFO] [09/23/2014 13:33:21.587] 
 [on-spray-can-akka.actor.default-dispatcher-2] 
 [akka://on-spray-can/user/$a/$a] Message 
 [akka.persistence.JournalProtocol$ReplayedMessage] from 
 Actor[akka://on-spray-can/user/$a#644188776] to 
 Actor[akka://on-spray-can/user/$a/$a#1751213071] was not delivered. [3] 
 dead letters encountered. This logging can be turned off or adjusted with 
 configuration settings 'akka.log-dead-letters' and 
 'akka.log-dead-letters-during-shutdown'.
 [INFO] [09/23/2014 13:33:21.587] 
 [on-spray-can-akka.actor.default-dispatcher-2] 
 [akka://on-spray-can/user/$a/$a] Message 
 [akka.persistence.JournalProtocol$ReplayedMessage] from 
 Actor[akka://on-spray-can/user/$a#1549609203] to 
 Actor[akka://on-spray-can/user/$a/$a#1751213071] was not delivered. [4] 
 dead letters encountered. This logging can be turned off or adjusted with 
 configuration settings 'akka.log-dead-letters' and 
 'akka.log-dead-letters-during-shutdown'.
 [INFO] [09/23/2014 13:33:21.587] 
 [on-spray-can-akka.actor.default-dispatcher-2] 
 [akka://on-spray-can/user/$a/$a] Message 
 [akka.persistence.JournalProtocol$ReplayedMessage] from 
 Actor[akka://on-spray-can/user/$a#1549609203] to 
 Actor[akka://on-spray-can/user/$a/$a#1751213071] was not delivered. [5] 
 dead letters encountered. This logging can be turned off or adjusted with 
 configuration settings 'akka.log-dead-letters' and 
 

Re: [akka-user] Re: combining receive pfs - am I being stupid here?

2014-09-23 Thread Tim Pigden
2.11.2 (akka 2.3.4)

scalacOptions := Seq(-feature, -deprecation, -encoding, utf8,
-Xlint)

On 23 September 2014 21:26, Adam adamho...@gmail.com wrote:

 Interesting.
 Which Scala version are you using?

 I've copied your code into a Scala project I have that uses Scala 2.11.2
 (with akka 2.3.6) and I get no warnings.
 Also the IDE (Intellij) correctly shows that receive is of type
 PartialFunction[Any,Unit].

 Have you tried modifying it to:

 def receive: Receive = { x orElse y }

 ?

 I would assume that should cause type inference to be skipped and
 therefore also make the warning go away, like in the previous answer.


 On Tuesday, September 23, 2014 7:29:08 PM UTC+3, Tim Pigden wrote:

 The following example:

 class TestPF extends Actor {

   val x: Receive = {
 case hi = sender ! hello
   }

   val y: Receive = {
 case bye = sender ! farewell
   }

   def receive = { x orElse y }

 }

 gets a warning
 Warning:(18, 28) a type was inferred to be `Any`; this may indicate a
 programming error.
   def receive = { x orElse y }
^

 Am I doing something wrong? I thought this was the intended use pattern.
 Can I make these warnings go away?

  --
  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 a topic in the
 Google Groups Akka User List group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/akka-user/0rkUCQxru5I/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




-- 
Tim Pigden
Optrak Distribution Software Limited
+44 (0)1992 517100
http://www.linkedin.com/in/timpigden
http://optrak.com
Optrak Distribution Software Ltd is a limited company registered in England
and Wales.
Company Registration No. 2327613 Registered Offices: Suite 6,The Maltings,
Hoe Lane, Ware, SG12 9LR England
This email and any attachments to it may be confidential and are intended
solely for the use of the individual to whom it is addressed. Any views or
opinions expressed are solely those of the author and do not necessarily
represent those of Optrak Distribution Software Ltd. If you are not the
intended recipient of this email, you must neither take any action based
upon its contents, nor copy or show it to anyone. Please contact the sender
if you believe you have received this email in error.

-- 
  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Re: combining receive pfs - am I being stupid here?

2014-09-23 Thread Tim Pigden
sorry meant to add - yes with or without { } it has the same and just
changing now to 2.3.6 it makes no different

On 23 September 2014 23:15, Tim Pigden tim.pig...@optrak.com wrote:

 2.11.2 (akka 2.3.4)

 scalacOptions := Seq(-feature, -deprecation, -encoding, utf8,
 -Xlint)

 On 23 September 2014 21:26, Adam adamho...@gmail.com wrote:

 Interesting.
 Which Scala version are you using?

 I've copied your code into a Scala project I have that uses Scala 2.11.2
 (with akka 2.3.6) and I get no warnings.
 Also the IDE (Intellij) correctly shows that receive is of type
 PartialFunction[Any,Unit].

 Have you tried modifying it to:

 def receive: Receive = { x orElse y }

 ?

 I would assume that should cause type inference to be skipped and
 therefore also make the warning go away, like in the previous answer.


 On Tuesday, September 23, 2014 7:29:08 PM UTC+3, Tim Pigden wrote:

 The following example:

 class TestPF extends Actor {

   val x: Receive = {
 case hi = sender ! hello
   }

   val y: Receive = {
 case bye = sender ! farewell
   }

   def receive = { x orElse y }

 }

 gets a warning
 Warning:(18, 28) a type was inferred to be `Any`; this may indicate a
 programming error.
   def receive = { x orElse y }
^

 Am I doing something wrong? I thought this was the intended use pattern.
 Can I make these warnings go away?

  --
  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 a topic in the
 Google Groups Akka User List group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/akka-user/0rkUCQxru5I/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




 --
 Tim Pigden
 Optrak Distribution Software Limited
 +44 (0)1992 517100
 http://www.linkedin.com/in/timpigden
 http://optrak.com
 Optrak Distribution Software Ltd is a limited company registered in
 England and Wales.
 Company Registration No. 2327613 Registered Offices: Suite 6,The Maltings,
 Hoe Lane, Ware, SG12 9LR England
 This email and any attachments to it may be confidential and are intended
 solely for the use of the individual to whom it is addressed. Any views or
 opinions expressed are solely those of the author and do not necessarily
 represent those of Optrak Distribution Software Ltd. If you are not the
 intended recipient of this email, you must neither take any action based
 upon its contents, nor copy or show it to anyone. Please contact the sender
 if you believe you have received this email in error.




-- 
Tim Pigden
Optrak Distribution Software Limited
+44 (0)1992 517100
http://www.linkedin.com/in/timpigden
http://optrak.com
Optrak Distribution Software Ltd is a limited company registered in England
and Wales.
Company Registration No. 2327613 Registered Offices: Suite 6,The Maltings,
Hoe Lane, Ware, SG12 9LR England
This email and any attachments to it may be confidential and are intended
solely for the use of the individual to whom it is addressed. Any views or
opinions expressed are solely those of the author and do not necessarily
represent those of Optrak Distribution Software Ltd. If you are not the
intended recipient of this email, you must neither take any action based
upon its contents, nor copy or show it to anyone. Please contact the sender
if you believe you have received this email in error.

-- 
  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Re: combining receive pfs - am I being stupid here?

2014-09-23 Thread Tim Pigden
seems to be to do with the Xlint option


On Tuesday, September 23, 2014 11:16:51 PM UTC+1, Tim Pigden wrote:

 sorry meant to add - yes with or without { } it has the same and just 
 changing now to 2.3.6 it makes no different

 On 23 September 2014 23:15, Tim Pigden tim.pig...@optrak.com wrote:

 2.11.2 (akka 2.3.4)

 scalacOptions := Seq(-feature, -deprecation, -encoding, utf8, 
 -Xlint)

 On 23 September 2014 21:26, Adam adamho...@gmail.com wrote:

 Interesting.
 Which Scala version are you using?

 I've copied your code into a Scala project I have that uses Scala 2.11.2 
 (with akka 2.3.6) and I get no warnings.
 Also the IDE (Intellij) correctly shows that receive is of type 
 PartialFunction[Any,Unit].

 Have you tried modifying it to:

 def receive: Receive = { x orElse y }

 ?

 I would assume that should cause type inference to be skipped and 
 therefore also make the warning go away, like in the previous answer.


 On Tuesday, September 23, 2014 7:29:08 PM UTC+3, Tim Pigden wrote:

 The following example:

 class TestPF extends Actor {

   val x: Receive = {
 case hi = sender ! hello
   }

   val y: Receive = {
 case bye = sender ! farewell
   }

   def receive = { x orElse y }

 }

 gets a warning
 Warning:(18, 28) a type was inferred to be `Any`; this may indicate a 
 programming error.
   def receive = { x orElse y }
^

 Am I doing something wrong? I thought this was the intended use 
 pattern. Can I make these warnings go away?

  -- 
  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 a topic in the 
 Google Groups Akka User List group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/akka-user/0rkUCQxru5I/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




 -- 
 Tim Pigden
 Optrak Distribution Software Limited
 +44 (0)1992 517100
 http://www.linkedin.com/in/timpigden
 http://optrak.com
 Optrak Distribution Software Ltd is a limited company registered in 
 England and Wales.
 Company Registration No. 2327613 Registered Offices: Suite 6,The 
 Maltings, Hoe Lane, Ware, SG12 9LR England 
 This email and any attachments to it may be confidential and are intended 
 solely for the use of the individual to whom it is addressed. Any views or 
 opinions expressed are solely those of the author and do not necessarily 
 represent those of Optrak Distribution Software Ltd. If you are not the 
 intended recipient of this email, you must neither take any action based 
 upon its contents, nor copy or show it to anyone. Please contact the sender 
 if you believe you have received this email in error.
  



 -- 
 Tim Pigden
 Optrak Distribution Software Limited
 +44 (0)1992 517100
 http://www.linkedin.com/in/timpigden
 http://optrak.com
 Optrak Distribution Software Ltd is a limited company registered in 
 England and Wales.
 Company Registration No. 2327613 Registered Offices: Suite 6,The Maltings, 
 Hoe Lane, Ware, SG12 9LR England 
 This email and any attachments to it may be confidential and are intended 
 solely for the use of the individual to whom it is addressed. Any views or 
 opinions expressed are solely those of the author and do not necessarily 
 represent those of Optrak Distribution Software Ltd. If you are not the 
 intended recipient of this email, you must neither take any action based 
 upon its contents, nor copy or show it to anyone. Please contact the sender 
 if you believe you have received this email in error.
  

-- 
  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] sort merge reactive streams

2014-09-23 Thread √iktor Ҡlang
Hi William,

I am not sure I understand the question, given N unbounded streams of
comparable items, what does the resulting stream look like?

On Tue, Sep 23, 2014 at 1:31 PM, William Le Ferrand warne...@gmail.com
wrote:

 Dear List,

 I've a set of reactive streams that contain ordered data. Is there an easy
 way to sort merge them into a single reactive stream? I couldn't find
 anything in the documentation nor on the web; I came up with a handmade
 solution but it looks unnecessary obfuscated

 Thanks in advance,

 Best
 William

 --
 William Le Ferrand

 Mobile : (+1) (415) 683-1484
 Web : http://williamleferrand.github.com/
 http://www.linkedin.com/in/williamleferrand

 --
  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 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




-- 
Cheers,
√

-- 
  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] sort merge reactive streams

2014-09-23 Thread William Le Ferrand
Victor,

It would be an unbounded stream of ordered items (potentially as slow as
the slowest source stream)

On Tue, Sep 23, 2014 at 3:59 PM, √iktor Ҡlang viktor.kl...@gmail.com
wrote:

 Hi William,

 I am not sure I understand the question, given N unbounded streams of
 comparable items, what does the resulting stream look like?

 On Tue, Sep 23, 2014 at 1:31 PM, William Le Ferrand warne...@gmail.com
 wrote:

 Dear List,

 I've a set of reactive streams that contain ordered data. Is there an
 easy way to sort merge them into a single reactive stream? I couldn't
 find anything in the documentation nor on the web; I came up with a
 handmade solution but it looks unnecessary obfuscated

 Thanks in advance,

 Best
 William

 --
 William Le Ferrand

 Mobile : (+1) (415) 683-1484
 Web : http://williamleferrand.github.com/
 http://www.linkedin.com/in/williamleferrand

 --
  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 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




 --
 Cheers,
 √

 --
  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 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




-- 
William Le Ferrand

Mobile : (+1) (415) 683-1484
Web : http://williamleferrand.github.com/
http://www.linkedin.com/in/williamleferrand

-- 
  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] sort merge reactive streams

2014-09-23 Thread √iktor Ҡlang
I still don't understand, if we have 2 unbounded streams, how do we sort
them without consuming all of them first?

On Tue, Sep 23, 2014 at 7:06 PM, William Le Ferrand warne...@gmail.com
wrote:

 Victor,

 It would be an unbounded stream of ordered items (potentially as slow as
 the slowest source stream)

 On Tue, Sep 23, 2014 at 3:59 PM, √iktor Ҡlang viktor.kl...@gmail.com
 wrote:

 Hi William,

 I am not sure I understand the question, given N unbounded streams of
 comparable items, what does the resulting stream look like?

 On Tue, Sep 23, 2014 at 1:31 PM, William Le Ferrand warne...@gmail.com
 wrote:

 Dear List,

 I've a set of reactive streams that contain ordered data. Is there an
 easy way to sort merge them into a single reactive stream? I couldn't
 find anything in the documentation nor on the web; I came up with a
 handmade solution but it looks unnecessary obfuscated

 Thanks in advance,

 Best
 William

 --
 William Le Ferrand

 Mobile : (+1) (415) 683-1484
 Web : http://williamleferrand.github.com/
 http://www.linkedin.com/in/williamleferrand

 --
  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 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




 --
 Cheers,
 √

 --
  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 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




 --
 William Le Ferrand

 Mobile : (+1) (415) 683-1484
 Web : http://williamleferrand.github.com/
 http://www.linkedin.com/in/williamleferrand

 --
  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 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




-- 
Cheers,
√

-- 
  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] sort merge reactive streams

2014-09-23 Thread William Le Ferrand
Sorry, the source stream are already sorted (that's what I meant earlier by
ordered data), so you just have to compare the head of your two sources
to decide which element you want to push in the outbound stream first. Does
it make sense?

On Tue, Sep 23, 2014 at 4:24 PM, √iktor Ҡlang viktor.kl...@gmail.com
wrote:

 I still don't understand, if we have 2 unbounded streams, how do we sort
 them without consuming all of them first?

 On Tue, Sep 23, 2014 at 7:06 PM, William Le Ferrand warne...@gmail.com
 wrote:

 Victor,

 It would be an unbounded stream of ordered items (potentially as slow as
 the slowest source stream)

 On Tue, Sep 23, 2014 at 3:59 PM, √iktor Ҡlang viktor.kl...@gmail.com
 wrote:

 Hi William,

 I am not sure I understand the question, given N unbounded streams of
 comparable items, what does the resulting stream look like?

 On Tue, Sep 23, 2014 at 1:31 PM, William Le Ferrand warne...@gmail.com
 wrote:

 Dear List,

 I've a set of reactive streams that contain ordered data. Is there an
 easy way to sort merge them into a single reactive stream? I couldn't
 find anything in the documentation nor on the web; I came up with a
 handmade solution but it looks unnecessary obfuscated

 Thanks in advance,

 Best
 William

 --
 William Le Ferrand

 Mobile : (+1) (415) 683-1484
 Web : http://williamleferrand.github.com/
 http://www.linkedin.com/in/williamleferrand

 --
  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 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




 --
 Cheers,
 √

 --
  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 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




 --
 William Le Ferrand

 Mobile : (+1) (415) 683-1484
 Web : http://williamleferrand.github.com/
 http://www.linkedin.com/in/williamleferrand

 --
  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 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




 --
 Cheers,
 √

 --
  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 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




-- 
William Le Ferrand

Mobile : (+1) (415) 683-1484
Web : http://williamleferrand.github.com/
http://www.linkedin.com/in/williamleferrand

-- 
  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] sort merge reactive streams

2014-09-23 Thread √iktor Ҡlang
Now it is way more clear! :) So you have 2 sorted streams that you want to
merge to be one sorted stream.
Right now I don't think there's a good machinery for doing this, but I may
be misinformed.
What does the solution that you came up with look like?



On Tue, Sep 23, 2014 at 7:29 PM, William Le Ferrand warne...@gmail.com
wrote:

 Sorry, the source stream are already sorted (that's what I meant earlier
 by ordered data), so you just have to compare the head of your two
 sources to decide which element you want to push in the outbound stream
 first. Does it make sense?

 On Tue, Sep 23, 2014 at 4:24 PM, √iktor Ҡlang viktor.kl...@gmail.com
 wrote:

 I still don't understand, if we have 2 unbounded streams, how do we sort
 them without consuming all of them first?

 On Tue, Sep 23, 2014 at 7:06 PM, William Le Ferrand warne...@gmail.com
 wrote:

 Victor,

 It would be an unbounded stream of ordered items (potentially as slow as
 the slowest source stream)

 On Tue, Sep 23, 2014 at 3:59 PM, √iktor Ҡlang viktor.kl...@gmail.com
 wrote:

 Hi William,

 I am not sure I understand the question, given N unbounded streams of
 comparable items, what does the resulting stream look like?

 On Tue, Sep 23, 2014 at 1:31 PM, William Le Ferrand warne...@gmail.com
  wrote:

 Dear List,

 I've a set of reactive streams that contain ordered data. Is there an
 easy way to sort merge them into a single reactive stream? I couldn't
 find anything in the documentation nor on the web; I came up with a
 handmade solution but it looks unnecessary obfuscated

 Thanks in advance,

 Best
 William

 --
 William Le Ferrand

 Mobile : (+1) (415) 683-1484
 Web : http://williamleferrand.github.com/
 http://www.linkedin.com/in/williamleferrand

 --
  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 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




 --
 Cheers,
 √

 --
  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 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




 --
 William Le Ferrand

 Mobile : (+1) (415) 683-1484
 Web : http://williamleferrand.github.com/
 http://www.linkedin.com/in/williamleferrand

 --
  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 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




 --
 Cheers,
 √

 --
  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 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




 --
 William Le Ferrand

 Mobile : (+1) (415) 683-1484
 Web : http://williamleferrand.github.com/
 http://www.linkedin.com/in/williamleferrand

 --
  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 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at 

Re: [akka-user] sort merge reactive streams

2014-09-23 Thread William Le Ferrand
It looks like that:
https://gist.github.com/williamleferrand/c77133af821d5eb278be (I feel bad
looking at it)

On Tue, Sep 23, 2014 at 4:38 PM, √iktor Ҡlang viktor.kl...@gmail.com
wrote:

 Now it is way more clear! :) So you have 2 sorted streams that you want to
 merge to be one sorted stream.
 Right now I don't think there's a good machinery for doing this, but I may
 be misinformed.
 What does the solution that you came up with look like?



 On Tue, Sep 23, 2014 at 7:29 PM, William Le Ferrand warne...@gmail.com
 wrote:

 Sorry, the source stream are already sorted (that's what I meant earlier
 by ordered data), so you just have to compare the head of your two
 sources to decide which element you want to push in the outbound stream
 first. Does it make sense?

 On Tue, Sep 23, 2014 at 4:24 PM, √iktor Ҡlang viktor.kl...@gmail.com
 wrote:

 I still don't understand, if we have 2 unbounded streams, how do we sort
 them without consuming all of them first?

 On Tue, Sep 23, 2014 at 7:06 PM, William Le Ferrand warne...@gmail.com
 wrote:

 Victor,

 It would be an unbounded stream of ordered items (potentially as slow
 as the slowest source stream)

 On Tue, Sep 23, 2014 at 3:59 PM, √iktor Ҡlang viktor.kl...@gmail.com
 wrote:

 Hi William,

 I am not sure I understand the question, given N unbounded streams of
 comparable items, what does the resulting stream look like?

 On Tue, Sep 23, 2014 at 1:31 PM, William Le Ferrand 
 warne...@gmail.com wrote:

 Dear List,

 I've a set of reactive streams that contain ordered data. Is there an
 easy way to sort merge them into a single reactive stream? I couldn't
 find anything in the documentation nor on the web; I came up with a
 handmade solution but it looks unnecessary obfuscated

 Thanks in advance,

 Best
 William

 --
 William Le Ferrand

 Mobile : (+1) (415) 683-1484
 Web : http://williamleferrand.github.com/
 http://www.linkedin.com/in/williamleferrand

 --
  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 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




 --
 Cheers,
 √

 --
  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 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




 --
 William Le Ferrand

 Mobile : (+1) (415) 683-1484
 Web : http://williamleferrand.github.com/
 http://www.linkedin.com/in/williamleferrand

 --
  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 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




 --
 Cheers,
 √

 --
  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 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




 --
 William Le Ferrand

 Mobile : (+1) (415) 683-1484
 Web : http://williamleferrand.github.com/
 http://www.linkedin.com/in/williamleferrand

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

Re: [akka-user] Unbinding a StreamTcp server binding

2014-09-23 Thread Björn Antonsson
Hi Chris,

You are right that it's undocumented right now. It's even a ticket for it here 
https://github.com/akka/akka/issues/15945

What you should try to do is cancel the connecrtionStream, which might not be 
easy to do since you probably did a foreach on it.

We are currently fixing this glitch when we are moving HTTP to the new stream 
DSL, and you will receive a Closeable that you can close to shut down the 
server.

B/

On 23 September 2014 at 20:42:32, Chris Baxter (cbax...@gmail.com) wrote:

I can't currently find a way to perform an Unbind with a StreamTcp server 
binding.  What if for some reason I no longer want to be connected to that 
socket.  The regular Tcp binding has a way to do this (by sending an Unbind to 
whoever responded to the original Bind request), but I don't see this same 
system in place for StreamTcp.  Am I missing something?
--
 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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

-- 
Björn Antonsson
Typesafe – Reactive Apps on the JVM
twitter: @bantonsson

-- 
  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Re: combining receive pfs - am I being stupid here?

2014-09-23 Thread Adam
I think you can assume this is some kind of bug.
According to the definition of Receive 
http://doc.akka.io/api/akka/2.3.6/?_ga=1.83289750.1264712766.1405541415#akka.actor.Actor$@Receive=PartialFunction[Any,Unit]
 
it's equivalent to PartialFunction[Any, Unit] and yet, the following 
generates no warning (changed the declared return type of y):

class TestPF extends Actor {

  val x: Receive = {
case hi = sender ! hello
  }

  val y: PartialFunction[Any, Unit] = {
case bye = sender ! farewell
  }

  def receive = x orElse y

}

So you should probably open a Scala bug for this, if there isn't already 
one.

On Wednesday, September 24, 2014 1:30:57 AM UTC+3, Tim Pigden wrote:

 seems to be to do with the Xlint option


 On Tuesday, September 23, 2014 11:16:51 PM UTC+1, Tim Pigden wrote:

 sorry meant to add - yes with or without { } it has the same and just 
 changing now to 2.3.6 it makes no different

 On 23 September 2014 23:15, Tim Pigden tim.p...@optrak.com javascript:
  wrote:

 2.11.2 (akka 2.3.4)

 scalacOptions := Seq(-feature, -deprecation, -encoding, utf8, 
 -Xlint)

 On 23 September 2014 21:26, Adam adam...@gmail.com javascript: 
 wrote:

 Interesting.
 Which Scala version are you using?

 I've copied your code into a Scala project I have that uses Scala 
 2.11.2 (with akka 2.3.6) and I get no warnings.
 Also the IDE (Intellij) correctly shows that receive is of type 
 PartialFunction[Any,Unit].

 Have you tried modifying it to:

 def receive: Receive = { x orElse y }

 ?

 I would assume that should cause type inference to be skipped and 
 therefore also make the warning go away, like in the previous answer.


 On Tuesday, September 23, 2014 7:29:08 PM UTC+3, Tim Pigden wrote:

 The following example:

 class TestPF extends Actor {

   val x: Receive = {
 case hi = sender ! hello
   }

   val y: Receive = {
 case bye = sender ! farewell
   }

   def receive = { x orElse y }

 }

 gets a warning
 Warning:(18, 28) a type was inferred to be `Any`; this may indicate a 
 programming error.
   def receive = { x orElse y }
^

 Am I doing something wrong? I thought this was the intended use 
 pattern. Can I make these warnings go away?

  -- 
  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 a topic in the 
 Google Groups Akka User List group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/akka-user/0rkUCQxru5I/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 akka-user+...@googlegroups.com javascript:.
 To post to this group, send email to akka...@googlegroups.com 
 javascript:.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




 -- 
 Tim Pigden
 Optrak Distribution Software Limited
 +44 (0)1992 517100
 http://www.linkedin.com/in/timpigden
 http://optrak.com
 Optrak Distribution Software Ltd is a limited company registered in 
 England and Wales.
 Company Registration No. 2327613 Registered Offices: Suite 6,The 
 Maltings, Hoe Lane, Ware, SG12 9LR England 
 This email and any attachments to it may be confidential and are 
 intended solely for the use of the individual to whom it is addressed. Any 
 views or opinions expressed are solely those of the author and do not 
 necessarily represent those of Optrak Distribution Software Ltd. If you are 
 not the intended recipient of this email, you must neither take any action 
 based upon its contents, nor copy or show it to anyone. Please contact the 
 sender if you believe you have received this email in error.
  



 -- 
 Tim Pigden
 Optrak Distribution Software Limited
 +44 (0)1992 517100
 http://www.linkedin.com/in/timpigden
 http://optrak.com
 Optrak Distribution Software Ltd is a limited company registered in 
 England and Wales.
 Company Registration No. 2327613 Registered Offices: Suite 6,The 
 Maltings, Hoe Lane, Ware, SG12 9LR England 
 This email and any attachments to it may be confidential and are intended 
 solely for the use of the individual to whom it is addressed. Any views or 
 opinions expressed are solely those of the author and do not necessarily 
 represent those of Optrak Distribution Software Ltd. If you are not the 
 intended recipient of this email, you must neither take any action based 
 upon its contents, nor copy or show it to anyone. Please contact the sender 
 if you believe you have received this email in error.
  


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