On Wed, Jan 22, 2014 at 5:36 PM, Amit Mula <amitm...@gmail.com> wrote:
> hi Patrik, yes I have switched to scala. I have started learning > functional programming and scala side by side. > > For my problem, its more concerned to scala, but not the build script as > stated by Victor. Regarding the example, I can understand the scala code > give here[ > http://doc.akka.io/docs/akka/2.2.3/contrib/distributed-pub-sub.html#A_Small_Example_in_Scala] > what I am not able to understand is how do i initialize the val context > I am not able to resolve context in this statement : val mediator = > DistributedPubSubExtension(context.system).mediator > Please let me know how do I initialize it. > Did you import scala.actors.Actor instead of akka.actor.Actor? Show us your imports. Cheers, √ > > > On Wednesday, 22 January 2014 20:00:16 UTC+5:30, Patrik Nordwall wrote: > >> Have you switched to Scala? >> Otherwise the java sample code is here: http://doc.akka.io/docs/ >> akka/2.2.3/contrib/distributed-pub-sub.html#A_Small_Example_in_Java >> >> /Patrik >> >> >> >> >> On Wed, Jan 22, 2014 at 3:19 PM, √iktor Ҡlang <viktor...@gmail.com>wrote: >> >>> Hi Amit, >>> >>> On Wed, Jan 22, 2014 at 3:07 PM, Amit Mula <amit...@gmail.com> wrote: >>> >>>> hi guys, >>>> >>>> I think i am still stuck, >>>> >>>> A simple actor that publishes to this "content" topic: >>>> >>>> >>>> 1. class Publisher extends Actor { >>>> 2. import DistributedPubSubMediator.Publish >>>> 3. // activate the extension >>>> 4. >>>> val mediator = DistributedPubSubExtension(context.system).mediator >>>> 5. >>>> 6. def receive = { >>>> 7. case in: String ⇒ >>>> 8. val out = in.toUpperCase >>>> 9. mediator ! Publish("content", out) >>>> 10. } >>>> 11. >>>> } >>>> >>>> how do i get a reference of context in the above code ? >>>> compiler says : *error: not found: value context* >>>> I am using maven to build >>>> >>>> >>> All our code samples are compiled and tested as a part of the build so >>> something is wrong is your build definition. >>> >>> Cheers, >>> √ >>> >>> >>>> -- >>>> >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>> >>>>>>>>>> Check the FAQ: http://akka.io/faq/ >>>> >>>>>>>>>> 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+...@googlegroups.com. >>>> To post to this group, send email to akka...@googlegroups.com. >>>> >>>> Visit this group at http://groups.google.com/group/akka-user. >>>> For more options, visit https://groups.google.com/groups/opt_out. >>>> >>> >>> >>> >>> -- >>> Cheers, >>> √ >>> >>> * ——————— **Viktor Klang* >>> *Chief Architect - **Typesafe <http://www.typesafe.com/>* >>> >>> Twitter: @viktorklang >>> >>> -- >>> >>>>>>>>>> Read the docs: http://akka.io/docs/ >>> >>>>>>>>>> Check the FAQ: http://akka.io/faq/ >>> >>>>>>>>>> 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+...@googlegroups.com. >>> To post to this group, send email to akka...@googlegroups.com. >>> >>> Visit this group at http://groups.google.com/group/akka-user. >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >> >> >> >> -- >> >> Patrik Nordwall >> Typesafe <http://typesafe.com/> - Reactive apps on the JVM >> Twitter: @patriknw >> >> -- > >>>>>>>>>> Read the docs: http://akka.io/docs/ > >>>>>>>>>> Check the FAQ: http://akka.io/faq/ > >>>>>>>>>> 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/groups/opt_out. > -- Cheers, √ *———————**Viktor Klang* *Chief Architect - **Typesafe <http://www.typesafe.com/>* Twitter: @viktorklang -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: http://akka.io/faq/ >>>>>>>>>> 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/groups/opt_out.