From 2ae6af81abbbde9826ffeccdb9af178c5355ebb8 Mon Sep 17 00:00:00 2001 From: arzumify Date: Wed, 8 Jan 2025 12:57:12 +0000 Subject: [PATCH] ISM rewrite part 6 --- main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.go b/main.go index fc142f7..ececaf8 100644 --- a/main.go +++ b/main.go @@ -170,6 +170,12 @@ func (s *ServiceInitializationInformation) SendISMessage(forService uuid.UUID, m return id } +func (s *InterServiceMessage) Respond(messageType MessageCode, message any) { + s.ServiceID, s.ForServiceID = s.ForServiceID, s.ServiceID + s.MessageType = messageType + s.Message = message +} + func (s *ServiceInitializationInformation) SendAndAwaitISMessage(forService uuid.UUID, messageType MessageCode, message any, timeout time.Duration) (InterServiceMessage, error) { id := s.SendISMessage(forService, messageType, message) return AwaitISMessage(id, timeout)