LiteCommands icon indicating copy to clipboard operation
LiteCommands copied to clipboard

Async context and arguments

Open BlackBaroness opened this issue 1 year ago • 2 comments

Is there a way to resolve context\arguments asynchronously? If not, I think it's important for many highload services. Of course, we always can resolve everything required in the command's body, but isn't the point of context types to remove this awkward code?

I think, context and arguments providers should classify if they can be resolved asynchronously (many of them are probably not). This is not relevant for most of the platforms, but is important for most of Minecraft ones - even on BungeeCord it makes sense to make expensive calls async, because otherwise it will load the Netty thread and increase a ping of a big part of total online (it could even disconnect them, if the call with take too long).

BlackBaroness avatar Sep 08 '24 22:09 BlackBaroness

bind, context and arguments are compatible with @Async annotation. Currently you can not define in argument resolver/context provider executor pool type. Checkout @Arg User user

Rollczi avatar Sep 08 '24 22:09 Rollczi

This is a good suggestion and I will follow the issue

huanmeng-qwq avatar Sep 12 '24 14:09 huanmeng-qwq