Skip to content

Commit

Permalink
Async XMPP client proposal (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
ForNeVeR committed Sep 1, 2019
1 parent 7c0a6d7 commit c209b6f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions Emulsion/Emulsion.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<Compile Include="Xmpp/SharpXmppHelper.fs" />
<Compile Include="Xmpp/XmppClient.fs" />
<Compile Include="Xmpp\Client.fs" />
<Compile Include="Xmpp\AsyncXmppClient.fs" />
<Compile Include="Actors/Factories.fs" />
<Compile Include="Actors/Core.fs" />
<Compile Include="Actors/Telegram.fs" />
Expand Down
32 changes: 32 additions & 0 deletions Emulsion/Xmpp/AsyncXmppClient.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
module Emulsion.Xmpp.AsyncXmppClient
open System.Security
open System.Threading

type ServerInfo = {
Host: string
Port: uint16
}

type SignInInfo = {
Login: string
Password: SecureString
}

type RoomInfo = {
RoomJid: string
Nickname: string
}

type MessageInfo = {
RecipientJid: string
Text: string
}

type Lifetime = CancellationToken // TODO[F]: Determine a proper lifetime?

type IAsyncXmppClient =
abstract member Connect : ServerInfo -> Async<unit>
abstract member SignIn : SignInInfo -> Async<unit>
abstract member EnterRoom : RoomInfo -> Async<Lifetime>
abstract member SendMessage : Lifetime -> MessageInfo -> Async<unit>
abstract member DisposeAsync : unit -> Async<unit>

0 comments on commit c209b6f

Please sign in to comment.