The @openziti.zitify() decorator currently does not return the result of the wrapped function, which leads to unexpected behavior when trying to use the function's return value outside its scope.
Steps to Reproduce
@openziti.zitify()
def query_emr(url, sql):
r = requests.post(url, json={"sql": sql})
return r.json()
output = query_emr("https://example.com", "SELECT * FROM table")
print(output) # Expected to see the JSON response, but prints `None`
is this expected behaviour?
additional issue
ncompatibility with async clients like httpx.AsyncClient
While using the openziti.monkeypatch() approach works well with synchronous libraries like requests, it fails when used with httpx.AsyncClient. Here's an example:
async with httpx.AsyncClient(cert=pem_path, verify=False, timeout=30.0) as client:
with openziti.monkeypatch(context=ztx):
response = await client.post(url, json=payload)
This raises the following error:
TypeError: ZitiSocket.__init__() got an unexpected keyword argument 'family'
is it expected, how to make this works on async method?