-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IMessageSystem implementation for XMPP (#29)
- Loading branch information
Showing
12 changed files
with
64 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,18 @@ | ||
namespace Emulsion.Xmpp | ||
|
||
open Akka.Actor | ||
open SharpXMPP | ||
open System.Threading | ||
|
||
open Emulsion | ||
open Emulsion.MessageSystem | ||
open Emulsion.Settings | ||
|
||
type Client = | ||
{ construct : IActorRef -> XmppClient | ||
run : XmppClient -> unit | ||
send : XmppClient -> string -> unit } | ||
type Client(ctx: RestartContext, cancellationToken: CancellationToken, settings: XmppSettings) as this = | ||
inherit MessageSystemBase(ctx, cancellationToken) | ||
let client = XmppClient.create settings | ||
|
||
with | ||
static member private create settings (core : IActorRef) = | ||
XmppClient.create settings core.Tell | ||
override __.RunUntilError receiver = | ||
XmppClient.run settings client receiver | ||
|
||
static member sharpXmpp (settings : XmppSettings) : Client = | ||
{ construct = Client.create settings | ||
run = XmppClient.run | ||
send = XmppClient.send settings } | ||
override __.Send (OutgoingMessage message) = async { | ||
return XmppClient.send settings client message | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters