You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

server_message_sender.go 2.1 kB

5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. package server
  2. import (
  3. "github.com/dubbogo/getty"
  4. "github.com/dk-lockdown/seata-golang/protocal"
  5. "time"
  6. )
  7. type IServerMessageSender interface {
  8. /**
  9. * Send response.
  10. *
  11. * @param request the request
  12. * @param channel the channel
  13. * @param msg the msg
  14. */
  15. SendResponse(request protocal.RpcMessage, session getty.Session, msg interface{})
  16. /**
  17. * Sync call to RM
  18. *
  19. * @param resourceId Resource ID
  20. * @param clientId Client ID
  21. * @param message Request message
  22. * @return Response message
  23. * @throws IOException .
  24. * @throws TimeoutException the timeout exception
  25. */
  26. SendSyncRequest(resourceId string, clientId string, message interface{}) (interface{},error)
  27. /**
  28. * Sync call to RM with timeout.
  29. *
  30. * @param resourceId Resource ID
  31. * @param clientId Client ID
  32. * @param message Request message
  33. * @param timeout timeout of the call
  34. * @return Response message
  35. * @throws IOException .
  36. * @throws TimeoutException the timeout exception
  37. */
  38. SendSyncRequestWithTimeout(resourceId string, clientId string, message interface{}, timeout time.Duration) (interface{},error)
  39. /**
  40. * Send request with response object.
  41. * send syn request for rm
  42. *
  43. * @param clientChannel the client channel
  44. * @param message the message
  45. * @return the object
  46. * @throws TimeoutException the timeout exception
  47. */
  48. SendSyncRequestByGettySession(session getty.Session, message interface{}) (interface{},error)
  49. /**
  50. * Send request with response object.
  51. * send syn request for rm
  52. *
  53. * @param clientChannel the client channel
  54. * @param message the message
  55. * @param timeout the timeout
  56. * @return the object
  57. * @throws TimeoutException the timeout exception
  58. */
  59. SendSyncRequestByGettySessionWithTimeout(session getty.Session, message interface{}, timeout time.Duration) (interface{},error)
  60. /**
  61. * ASync call to RM
  62. *
  63. * @param channel channel
  64. * @param message Request message
  65. * @return Response message
  66. * @throws IOException .
  67. * @throws TimeoutException the timeout exception
  68. */
  69. SendASyncRequest(session getty.Session, message interface{}) error
  70. }

Go Implementation For Seata