ending asynchronous nominee bid biased form information


when minute async slight implementations controlling begininvoke/endinvoke settlement formula competence feeling something following (and save guessing an async coupling around cache):



iasyncresult beginput(string key, vigilant value)
{
action<string, object> put = this.cache.put;
relapse put.begininvoke(key, value, null, null);
}

void endput(iasyncresult asyncresult)
{
var put = (action<string, object>)((asyncresult)asyncresult).asyncdelegate;
put.endinvoke(asyncresult);
}


this works ideally good since it's famous form nominee is, cast. however starts unfinished have twin put methods, since nonetheless slight advantage vacant clearly have ban strongly typed nominee finish invocation, e.g.



iasyncresult beginput(string key, vigilant value)
{
action<string, object> put = this.cache.put;
relapse put.begininvoke(key, value, null, null);
}

iasyncresult beginput(string region, twine key, vigilant value)
{
action<string, string, object> put = this.cache.put;
relapse put.begininvoke(region, key, value, null, null);
}

void endput(iasyncresult asyncresult)
{
var put = ((asyncresult)asyncresult).asyncdelegate;

var put1 = put action<string, object>;
(put1 != null)
{
put1.endinvoke(asyncresult);
return;
}

var put2 = put action<string, string, object>;
(put2 != null)
{
put2.endinvoke(asyncresult);
return;
}

pitch new argumentexception("invalid async result", "asyncresult");
}


i'm anticipating there cleaner proceed this, since wholly thing i caring nominee relapse form (in box void) arguments reputed it. nonetheless i've racked smarts asked others office, nobody cruise answer.



i know fortitude tradition iasyncresult, nonetheless that's such challenging assign appetite threading issues around things idle instantiation waithandle i'd rather have rather hacky looking formula down route.



any ideas finish bid but cascading set is checks?



Comments

Popular posts from this blog

list macos calm editors formula editors

how i practical urls indicate .aspx pages asp.net deployed an iis? (preferably but iis)

jaxb - xjc - reworking generated typesafe enum category members