KO
|
EN
gitlite — search
Search
#react
#python
#javascript
#hacktoberfest
#webpack
#docker
#electron
#android
#plugin
#macos
#metrics
#aws
Barkety
★ 33
Open GitHub ↗
Scala/Akka XMPP client library
Download README (.md)
Explore Similar Repositories
GA-svm
:
使用libsvm和遗传算法优化支持向量机的cost和gamma参数
AtomicPHP
:
A PHP5.3+ HMVC Framework
launchbar-scripts
:
My Launchbar Scripts
ncmpy
:
a curses mpd client;
node-tilejson
:
Tile source backend for online tile sources
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
Barkety
?
Download (.md)
Barkety - An Akka compatible XMPP client library. ================================================= While the [Apache Camel](http://camel.apache.org) project has an xmpp component and though [Jive Software's Smack](http://www.igniterealtime.org/projects/smack/) is ubiquitous neither fulfill my desires: * Convenient roster management, * supervision hierarchy ready, * and actor-level isolation of state management. Akka's bindings to camel-xmpp provide the last two and plain Smack allows only the first point. Usage ----- The tippy-top of the supervision hierarchy is ChatSupervisor. It understands `CreateChat(partner:JID)` messages and will reply back with an ActorRef to a Chatter actor. You must send this actor `RegisterParent(ref:ActorRef)` in order to route inbound messages to another actor. `OutboundMessage(msg:String)` will send a message to the partner connected by the Chatter. By default, all chats are preceded by roster subscription invitations. ``` import us.troutwine.barkety._ import akka.actor.Actor.actorOf import akka.actor.{Actor,ActorRef} class Acty(child:ActorRef) extends Actor { child ! RegisterParent(self) def receive = { case InboundMessage(msg:String) => println(msg) } } object Main extends Application { val jid = JID("barketyTest@jabber.org") val chatsup = actorOf(new ChatSupervisor(jid, "123456")).start (chatsup !! CreateChat(JID("troutwine@jabber.org"))) match { case Some(chatter) => actorOf(new Acty(chatter)).start chatter ! OutboundMessage("Hi, you!") case None => } } ``` [](https://bitdeli.com/free "Bitdeli Badge")