Server lagging with each webrequest.EnqueueNot An Issue
https://oxidemod.org/threads/coroutines-not-working.18364/

https://umod.org/community/rust/9654-waiting-for-webrequest-callback

 I would normally use coroutines but Oxide does not provide it I can see this by the lack of the ability to return yield and resume 
string res = "";
webrequest.Enqueue("https://google.com", "", (code, response) =>
{
    res = response;
}, this);​

this may just be my bigO/networking failing elsewhere but it would be nice to see my 8 core rust server I'm paying for use the other 7 cores I know a few servers I play on that would agree
maybe this below would do it if it does not rely on MonoBehaviour

I'm just looking for a UDP packet spammer to my python webserver with no lag
ill try https://80.lv/articles/simple-multithreading-for-unity/ and post back if I find why I'm lagging my server 

Webrequests run in a separate thread like coroutines, so it is unlikely to be the cause of your problem.

Your server will not use more than 1-2 cores, as that is what Unity and Rust use.

@Fenderrex coroutines does work in oxide. Linking a single post from 3yrs back doesn't seem like you did an rnd on your side. Have a look at the performance plugin to see coroutines in action oxide. 

And lastly, there is no way a dingle we request is lagging your server. If you are firing 20+ and doing a bunch of ETL with the response, then yes. 
yes sorry for not updating back here I found you can define a monobehavor subclass and attach it to a gameObject and unity will manage the coroutines as expected

Merged post

the lambda functions in the webrequest seam to be scheduled to be returned in bulk in the same game tick. I'm pulling terrain data every time I plant hemp and spamming all it over individual web request it would be nice not to need to manage packets depart times as the lag spike seems to not care for the request depart(webserver prints request) but when the lambda function in rust returns a few tick later with all other returns. It would be nice to have some bach control like time spent in request thread and yield types.
Locked automatically