-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMessageTypes.fs
More file actions
52 lines (39 loc) · 1.28 KB
/
Copy pathMessageTypes.fs
File metadata and controls
52 lines (39 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
module MessageTypes
open Akka.Actor
// Message type deffinitions for serialization
type UsernameMsg = {username:string}
type HashtagMsg = {tag:string}
type TweetMsg = {tweet:string; user:string}
type ReTweetMsg = {origId:int; user:string}
type SubscribeMsg = {subTo:string; user:string}
type SimInitSubsMsg = {username: string; numSubs: int}
type TweetData(id: int, tweet: string, user: string) =
member this.id = id
member this.tweet = tweet
member this.user = user
type TweetsMsg(tweets:TweetData[]) =
member this.tweets = tweets
type StatsMsg(numTweets: int, timeProcessing: float) =
member this.numTweets = numTweets
member this.timeProcessing = timeProcessing
// server message types
type ServerMsg =
| Login of string * IActorRef
| Logout of string
| PostTweet of string * string
| SubscribeTo of string * string
| RegisterUser of string
| ReTweet of int * string
| GetTweetsSubscribedTo of string
| GetTweetsByMention of string
| GetTweetsByHashtag of string
| SimulateSetInitialSubs of string * int
| GetStatistics
// user message types
type UserMsg =
| ReceiveTweet of TweetData // id, tweet, user
| RequestLogin of string
| RecieveStatistics of StatsMsg
| QueryTweets of TweetsMsg
| ReqSuccess
| ReqFailure