[Suggestion] Add Latent Server Callback Support #651
Description
Is your feature request related to a problem? Please describe.
You can use TriggerLatentClientEvent
function to send data to a client that doesn't block the clients network channel. So it would be great if we could register a latent callback instead when needed. This would be more flavourful when sending large amounts of data or for non time critical events, to stop blocking of the client network channel.
Describe the solution you'd like
A function like lib.callback.register
call it say lib.callback.registerLatent
, which uses TriggerLatentClientEvent
instead of TriggerClientEvent
for client and TriggerLatentServerEvent
instead of TriggerServerEvent
for server.
Default of bps of 50000
with an argument to higher or lower it.
Additional context
https://docs.fivem.net/docs/scripting-manual/working-with-events/triggering-events/#triggering-latent-server-events
https://docs.fivem.net/docs/scripting-manual/working-with-events/triggering-events/#triggering-latent-client-events
Hope this makes sense 😊