Skip to content

Conversation

lhames
Copy link
Contributor

@lhames lhames commented Sep 5, 2025

Introduces the following key APIs:

orc_rt_WrapperFunction defines the signature of an ORC asynchronous wrapper function:

typedef void (*orc_rt_WrapperFunctionReturn)(
    orc_rt_SessionRef Session, void *CallCtx,
    orc_rt_WrapperFunctionBuffer ResultBytes);

typedef void (*orc_rt_WrapperFunction)(orc_rt_SessionRef Session, void *CallCtx,
                                       orc_rt_WrapperFunctionReturn Return,
                                       orc_rt_WrapperFunctionBuffer ArgBytes);

A wrapper function takes a reference to the session object, a context pointer for the call being made, and a pointer to an orc_rt_WrapperFunctionReturn function that can be used to send the result bytes.

The orc_rt::WrapperFunction utility simplifies the writing of wrapper functions whose arguments and return values are serialized/deserialized using an abstract serialization utility.

The orc_rt::SPSWrapperFunction utility provides a specialized version of orc_rt::WrapperFunction that uses SPS serialization.

Introduces the following key APIs:

`orc_rt_WrapperFunction` defines the signature of an ORC asynchronous wrapper
function:

```
typedef void (*orc_rt_WrapperFunctionReturn)(
    orc_rt_SessionRef Session, void *CallCtx,
    orc_rt_WrapperFunctionBuffer ResultBytes);

typedef void (*orc_rt_WrapperFunction)(orc_rt_SessionRef Session, void *CallCtx,
                                       orc_rt_WrapperFunctionReturn Return,
                                       orc_rt_WrapperFunctionBuffer ArgBytes);
```

A wrapper function takes a reference to the session object, a context pointer
for the call being made, and a pointer to an orc_rt_WrapperFunctionReturn
function that can be used to send the result bytes.

The `orc_rt::WrapperFunction` utility simplifies the writing of wrapper
functions whose arguments and return values are serialized/deserialized using
an abstract serialization utility.

The `orc_rt::SPSWrapperFunction` utility provides a specialized version of
`orc_rt::WrapperFunction` that uses SPS serialization.
@lhames lhames merged commit e031a56 into llvm:main Sep 5, 2025
10 checks passed
@lhames lhames deleted the orc-rt-wrapperfunctionutils branch September 5, 2025 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant