This pull request aims to address issue #82, which relates to the loss of context deadlines when performing RPCs over the network using the HTTP client. The proposed solution is to propagate the context deadline as a header in the HTTP requests, ensuring that the deadlines are preserved throughout the network communication.
The following changes have been made to achieve this:
Created a new constant HttpHeaderTimeout in virtual/types/http.go to define the custom header name for context timeouts in HTTP requests.
Added a new function getContextFromRequest in the virtual/server.go file to extract the timeout value from the request header. This enables the propagation of context deadlines in HTTP headers.
Updated the InvokeActorRemote function in virtual/client.go to include the context deadline as a header in the HTTP requests.
Description
This pull request aims to address issue #82, which relates to the loss of context deadlines when performing RPCs over the network using the HTTP client. The proposed solution is to propagate the context deadline as a header in the HTTP requests, ensuring that the deadlines are preserved throughout the network communication.
The following changes have been made to achieve this:
Created a new constant
HttpHeaderTimeout
invirtual/types/http.go
to define the custom header name for context timeouts in HTTP requests.Added a new function
getContextFromRequest
in thevirtual/server.go
file to extract the timeout value from the request header. This enables the propagation of context deadlines in HTTP headers.Updated the
InvokeActorRemote
function invirtual/client.go
to include the context deadline as a header in the HTTP requests.