def session
import ezmcp@0.1.0.0/src/server.bend as Serverimport Base
import ezmcp@0.1.0.0/src/rpc.bend as Rpc
99# the revision the messages after this one are read by: the one the server
100# answers an initialize request with, else the one they were read by
101def session(rev: String, msg: Rpc.Msg) -> String:
102 match msg:
103 case Rpc.Ask{id, +m, params}:
104 session.ask(rev, params, String.eq(m, "initialize"))
105 case Rpc.Tell{m, params}:
106 rev
107 case Rpc.Answer{id}:
108 rev
109 case Rpc.Junk{id, why}:
110 rev