package Ġplay w rig kt . sk ript . stage manager Ċ Ċ import Ġcom . rabbitmq . client . AM QP Ċ import Ġcom . rabbitmq . client . ConnectionFactory Ċ import Ġplay w rig kt . sk ript . coroutine . run Async Ċ import Ġplay w rig kt . sk ript . result . AsyncResult Ċ import Ġplay w rig kt . sk ript . tro upe . A mq p Publish Tro upe Ċ import Ġplay w rig kt . sk ript . tro upe . Queue Publish Tro upe Ċ Ċ data Ġclass ĠA mq p Publish Stage Manager ( ĊĠĠĠĠĠĠĠ Ġval Ġexchange : ĠString , ĊĠĠĠĠĠĠĠ Ġval Ġconnection Factory : ĠConnection Factory , ĊĠĠĠĠĠĠĠ Ġval Ġbasic Properties : ĠAMQP . Basic Properties ): ĠStage Manager < Queue Publish Tro upe > Ġ{ ĊĠĠĠ Ġval Ġam qp Connection Ġby Ġlazy Ġ{ ĊĠĠĠĠĠĠĠ Ġconnection Factory . new Connection () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġh ire Tro upe (): ĠQueue Publish Tro upe Ġ= ĠA mq p Publish Tro upe ( exchange , Ġam qp Connection , Ġbasic Properties ) ĊĊĠĠĠ Ġoverride Ġfun ĠtearDown (): ĠAsync Result < Unit > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġrun Async Ġ{ Ġam qp Connection . close () Ġ} ĊĠĠĠ Ġ} Ċ }