Access custom go runtime via http for progress

We have a go module we use to gather and resize a bunch of images to return to our unity client, which we’re currently using as an nakama rpc call using the Unity sdk. Would it be possible to access this same go module but use a UnityWebRequest with the necessary payload, and get the response size and download progress information?

@oscargoldman Just to make sure I understand correctly:

  1. You’re sending long-running work to the server via an RPC function.
  2. I assume this spins off into a goroutine to do the work, and allows the RPC to return. (Is this the case?)
  3. You want the caller to be able to check progress on this long-running task.

The easiest way I can think of to do this is have the long-running task goroutine periodically report back to the user that created it using in-app notifications. You could also have a second RPC that checks for the outcome of the first, in your case I assume those images would end up stored somewhere so you could check if that’s completed by looking for the final images - in your situation I’d prefer the in-app notifications route I think.

1 Like

Thanks Andrei, sorry for the late response. We’re noobs at go programming so didn’t have goroutines involved in the image gathering module, so we’re working on that right now. The images are stored next to nakama, in the data folder, and are resized and converted to base64strings and returned as a payload to the unity client and reconverted back to sprites, so the payload of the rpc is actually a string block. we could probably do without the rpc time to gather and convert the images, but once the string payload is ready, I’d think we’d know it’s size and progress through regular http transfer, so I’ll give that a try. Thanks again!

1 Like