package Ġdev . sch la ubi . for p . analyze . server . conver sta ion Ċ Ċ import Ġdev . sch la ubi . for p . analyze . Conversation Ċ import Ġdev . sch la ubi . for p . analyze . StackTrace Analyzer Ċ import Ġdev . sch la ubi . for p . analyze . remote . Remote Event Ċ import Ġdev . sch la ubi . for p . analyze . remote . serial izable Ċ import Ġdev . sch la ubi . for p . analyze . server . Application Ċ import Ġkotlinx . coroutines . Job Ċ import Ġkotlinx . coroutines . flow . launch In Ċ import Ġkotlinx . coroutines . flow . on Each Ċ Ċ object ĠCon versation Manager Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġconversations Ġ= Ġmutable Map Of < Long , ĠAPI Conversation >() ĊĊĠĠĠ Ġsuspend Ġfun Ġnew ( token : ĠString ): ĠCon versation Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġnew Ġ= ĠApplication . analyzer . new Api Conversation ( token ) ĊĠĠĠĠĠĠĠ Ġconversations [ new . id ] Ġ= Ġnew ĊĊĠĠĠĠĠĠĠ Ġreturn Ġnew ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġfind Conversation ( id : ĠLong ) Ġ= Ġconversations [ id ] Ġ?: Ġinvalid Conversation () ĊĊĠĠĠ Ġinternal Ġfun Ġforget ( conversation : ĠCon versation ) Ġ{ ĊĠĠĠĠĠĠĠ Ġconversations . remove ( conversation . id ) ĊĠĠĠ Ġ} Ċ } Ċ Ċ private Ġfun Ġinvalid Conversation (): ĠNothing Ġ= Ġthrow ĠInvalid Conversation Exception () Ċ Ċ private Ġsuspend Ġfun ĠStack Trace Analyzer . new Api Conversation ( token : ĠString ): ĠAPI Conversation Ġ= ĊĠĠĠ ĠAPI Conversation ( token , Ġcreate New Conversation ()) Ċ Ċ class ĠAPI Conversation ( val Ġtoken : ĠString , Ġprivate Ġval Ġparent : ĠCon versation ) Ġ: ĊĠĠĠ ĠCon versation Ġby Ġparent Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġlistener : ĠJob Ġ= Ġevents . on Each Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġevent Ġ= ĠRemote Event ( id , Ġit . serial izable ()) ĊĠĠĠĠĠĠĠ ĠApplication . web Socket . report Event ( this , Ġevent ) ĊĠĠĠ Ġ}. launch In ( Application ) ĊĊĠĠĠ Ġoverride Ġfun Ġforget () Ġ{ ĊĠĠĠĠĠĠĠ Ġparent . forget () ĊĠĠĠĠĠĠĠ Ġlistener . cancel () ĊĠĠĠĠĠĠĠ ĠCon versation Manager . forget ( this ) ĊĠĠĠ Ġ} Ċ } Ċ Ċ class ĠInvalid Conversation Exception Ġ: ĠRuntimeException () Ċ