nostrum icon indicating copy to clipboard operation
nostrum copied to clipboard

Unsafe & Async Helper Proof of Concept

Open bdanklin opened this issue 1 year ago • 1 comments

This shows a proof of concept for auto generating bang functions. A similar method can be applied to trivially generate async functions using Task.

@async
@unsafe
def create_reaction(arg1, arg2, arg3) do

results in the following function definitions

def create_reaction(arg1, arg2, arg3), do: ...
def create_reaction!(arg1, arg2, arg3), do: ...
def create_reaction_async(arg1, arg2, arg3), do: ...

image

bdanklin avatar Jun 19 '23 00:06 bdanklin

With async I think we need to go the reverse route.

The default needs to be _async and the sync functions then call that and await on the response.

jchristgit avatar Jun 19 '23 07:06 jchristgit