ISM rewrite part 6

This commit is contained in:
Tracker-Friendly 2025-01-08 12:57:12 +00:00
parent b005f7f10a
commit 2ae6af81ab
1 changed files with 6 additions and 0 deletions

View File

@ -170,6 +170,12 @@ func (s *ServiceInitializationInformation) SendISMessage(forService uuid.UUID, m
return id 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) { func (s *ServiceInitializationInformation) SendAndAwaitISMessage(forService uuid.UUID, messageType MessageCode, message any, timeout time.Duration) (InterServiceMessage, error) {
id := s.SendISMessage(forService, messageType, message) id := s.SendISMessage(forService, messageType, message)
return AwaitISMessage(id, timeout) return AwaitISMessage(id, timeout)