nimblebox logo
Docs
v3.3.1b

nbox.nbxlib.serving

NBX Operator Serving

This file has all the functions on how the serving of an Operator works, it also acts as the default code that runs on NBX Deploy service.

If you find yourself using this reach out to NimbleBox support.

Functions

iconfunctionserve_operator
[source]
(op_or_app:None,host:None,port:None)
Parameters
  • op_or_app -

    The operator or FastAPI app to serve.

  • host -

    The host to serve on.

  • port -

    The port to serve on.

Serve an operator or a FastAPI app on a given host and port.

iconfunctionget_fastapi_routes
[source]

To keep seperation of responsibility the paths are scoped out like all the functions are in the /method_{...} and all the custom python code is in /nbx_py_rpc

iconfunctionget_fastapi_fn
[source]
(fn:Callable,_rest:bool)
Parameters
  • fn -

    function to be used as a fastapi route

  • _rest -

    if the function is a REST endpoint. Defaults to False.

This function is used to generate a fastapi route for a given function, it will take in a function and return a function that can be used as a fastapi route

Returns:

  • Callable: a function that can be used as a fastapi route
iconfunctionnbx_py_rpc
[source]

Classes

iconclassSupportedServingTypes
[source]
iconfunctionall
[source]
iconclassNbxPyRpc
[source]
iconfunction__init__
[source]
iconfunctionforward
[source]
iconfunctionfn_getattr
[source]
iconfunctionfn_getitem
[source]
iconfunctionfn_setitem
[source]
iconfunctionfn_delitem
[source]
iconfunctionfn_iter
[source]
iconfunctionfn_next
[source]
iconfunctionfn_len
[source]
iconfunctionfn_contains
[source]
nbox SDKnbox provides built in access to all the APIs and packages them in the most user friendly manner.Star 0