SersEventService.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. using Sers.Core.Module.PubSub;
  4. using Vit.Core.Module.Log;
  5. namespace Sers.Gover.Service.SersEvent
  6. {
  7. /// <summary>
  8. /// 目前有 SersEvent.ServiceStation.Start 、 SersEvent.ServiceStation.Pause、 SersEvent.ServiceStation.Add、 SersEvent.ServiceStation.Remove
  9. /// </summary>
  10. public class SersEventService
  11. {
  12. public const string Event_ServiceStation_Start = "Start";
  13. public const string Event_ServiceStation_Pause = "Pause";
  14. public const string Event_ServiceStation_Add = "Add";
  15. public const string Event_ServiceStation_Remove = "Remove";
  16. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  17. public static void Publish(string eventName,object msgBody)
  18. {
  19. try
  20. {
  21. MessageClient.Publish("SersEvent.ServiceStation."+ eventName, msgBody);
  22. }
  23. catch (Exception ex)
  24. {
  25. Logger.Error(ex);
  26. }
  27. }
  28. }
  29. }