[Serve] [Doc] Clarify custom method call (#11485)

This commit is contained in:
Simon Mo
2020-10-20 10:41:30 -07:00
committed by GitHub
parent e663b524ae
commit ef96793d3f
+6 -3
View File
@@ -47,8 +47,8 @@ endpoint. This returns a Ray ObjectRef whose result can be waited for or retriev
ray.get(handle.remote(request))
How do I call a method on my backend class besides __call__?
-------------------------------------------------------------
How do I call a method on my replica besides __call__?
------------------------------------------------------
To call a method via HTTP use the header field ``X-SERVE-CALL-METHOD``.
@@ -67,9 +67,12 @@ To call a method via Python, use :mod:`handle.options <ray.serve.handle.RayServe
self.count += inc
return True
handle = client.get_handle("backend_name")
handle = client.get_handle("endpoint_name")
handle.options(method_name="other_method").remote(5)
The call is the same as a regular query except a different method is called
within the replica. It is compatible with batching as well.
How do I enable CORS and other HTTP features?
---------------------------------------------