You need to actually define functions rather than just variables - you want something like
member private this.SynchronousRespsonse() =
let c = System.Console.ReadKey()
if c.Key = System.ConsoleKey.Q then
this.unsubscibe
else
let eventObj : Event = session.NextEvent()
for msg in eventObj do
printfn "%A" msg.ToString
this.SynchronusResponse()
Also, the extra rec
binding is not required and you want the recursion to occur only in the else
block so that you can return after Q
is pressed