mirror of https://github.com/crossplane/docs.git
Omit FunctionRunner class in introductory Python examples
In reality you need this, but I don't think we need to introduce it straight away. In the Go example we already omit the equivalent. Signed-off-by: Nic Cope <nicc@rk0n.org>
This commit is contained in:
parent
69f641f894
commit
42f17d9650
|
@ -154,13 +154,7 @@ method in `function/fn.py`. When you first open the file it contains a "hello
|
||||||
world" function.
|
world" function.
|
||||||
|
|
||||||
```python {label="hello-world"}
|
```python {label="hello-world"}
|
||||||
class FunctionRunner(grpcv1beta1.FunctionRunnerService):
|
async def RunFunction(self, req: fnv1beta1.RunFunctionRequest, _: grpc.aio.ServicerContext) -> fnv1beta1.RunFunctionResponse:
|
||||||
def __init__(self):
|
|
||||||
self.log = logging.get_logger()
|
|
||||||
|
|
||||||
async def RunFunction(
|
|
||||||
self, req: fnv1beta1.RunFunctionRequest, _: grpc.aio.ServicerContext
|
|
||||||
) -> fnv1beta1.RunFunctionResponse:
|
|
||||||
log = self.log.bind(tag=req.meta.tag)
|
log = self.log.bind(tag=req.meta.tag)
|
||||||
log.info("Running function")
|
log.info("Running function")
|
||||||
|
|
||||||
|
@ -193,13 +187,7 @@ for `RunFunctionRequest` and `RunFunctionResponse` in the
|
||||||
Edit the `RunFunction` method to replace it with this code.
|
Edit the `RunFunction` method to replace it with this code.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
class FunctionRunner(grpcv1beta1.FunctionRunnerService):
|
async def RunFunction(self, req: fnv1beta1.RunFunctionRequest, _: grpc.aio.ServicerContext) -> fnv1beta1.RunFunctionResponse:
|
||||||
def __init__(self):
|
|
||||||
self.log = logging.get_logger()
|
|
||||||
|
|
||||||
async def RunFunction(
|
|
||||||
self, req: fnv1beta1.RunFunctionRequest, _: grpc.aio.ServicerContext
|
|
||||||
) -> fnv1beta1.RunFunctionResponse:
|
|
||||||
log = self.log.bind(tag=req.meta.tag)
|
log = self.log.bind(tag=req.meta.tag)
|
||||||
log.info("Running function")
|
log.info("Running function")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue