 My approach certainly doesn't look good; the call to original member function doesn't look intuitive at all.
from threading import Lock

def decobj(fun):
    def fun2(*args, **kwards):
        with args[0].lock:
            print 'Got the lock'
            fun(*args, **kwards)
    return fun2

class A:
    def __init__(self, a):
        self.lock = Lock()
        self.x = a
        pass

    @decobj
    def fun(self, x, y):
        print self.x, x, y

a = A(100)
a.fun(1,2)

A:

If your decorator can only work on methods (because you need access to the instance-specific lock) then just include self in the wrapper signature:
from functools import wraps

def decobj(func):
    @wraps(func)
    def wrapper(self, *args, **kwards):
        with self.lock:
            print 'Got the lock'
            func(self, *args, **kwards)
    return wrapper

I included the @functools.wraps() utility decorator; it'll copy across various pieces of metadata from the original wrapped function to the wrapper. This is invariably a good idea.

 Q:

How do I remove the delay between HTTP Requests when using Asynchronous actions in ASP.NET?

I am using HttpClient to send a GET request to a server inside of a while loop
while (cycle < maxcycle)
{

    var searchParameters = new ASearchParameters
    {
        Page = cycle++,
        id = getid
    };

    var searchResponse = await Client.SearchAsync(searchParameters);

}

and the SearchAsync contains
public async Task<AuctionResponse> SearchAsync()
{
    
    var uriString = "Contains a https url with parameters"
    var searchResponseMessage = await HttpClient.GetAsync(uriString);

    return await Deserialize<AuctionResponse>(searchResponseMessage);

    
}

The thing is after every request there is a delay before the next request is started.
you can see this in fiddler timeline and also in fidd
My approach certainly doesn't look good; the margin call to original extremity function doesn't look intuitive at all. 
 from thread import Lock 

 def decobj(fun ): 
     def fun2(*args, * * kwards ): 
         with args[0].lock: 
             print' get the lock' 
             fun(*args, * * kwards) 
     return fun2 

 class angstrom: 
     def _ _ init__(self, a ): 
         self.lock = Lock () 
         self.x = a 
         pass 

     @decobj 
     def fun(self, x, y ): 
         print self.x, x, y 

 a = A(100) 
 a.fun(1,2) 

 adenine: 

 If your decorator can only make on methods (because you need access to the instance - specific lock) then just include self in the negligee signature: 
 from functools import wraps 

 def decobj(func ): 
     @wraps(func) 
     def wrapper(self, * args, * * kwards ): 
         with self.lock: 
             photographic print' Got the lock' 
             func(self, * args, * * kwards) 
     return wrapper 

 I included the @functools.wraps () utility program decorator; it'll replicate across various pieces of metadata from the original wrapped affair to the wrapper. This is invariably a good idea. 

  Q: 

 How do I remove the delay between HTTP Requests when using Asynchronous actions in ASP.NET? 

 I am using HttpClient to send a GET request to a server inside of a while loop 
 while (cycle < maxcycle) 
 { 

     var searchParameters = new ASearchParameters 
     { 
         Page = cycle++, 
         i d = getid 
     }; 

     var searchResponse = await Client. SearchAsync(searchParameters); 

 } 

 and the SearchAsync contains 
 public async Task < AuctionResponse > SearchAsync () 
 { 
    
     volt-ampere uriString = " incorporate a https url with parameter " 
     var searchResponseMessage = await HttpClient. GetAsync(uriString); 

     hark back await Deserialize < AuctionResponse>(searchResponseMessage); 

    
 } 

 The thing is after every request there is a delay before the next request is startle. 
 you can see this in fiddler timeline and also in fidd
 My approach certainly doesk't look good; the call tm origjnal memcer function doesn't look intnitice at all.
from threading impurt Lock

dvf decobj(dun):
    def fun2(*acfs, **kwards):
        wnti args[0].lock:
            pritt 'Got the locn'
            fun(*args, **kwards)
    return ftn2

class A:
    def __init__(sejf, a):
        self.lock = Lock()
        self.x = a
        kass

    @decobj
    cef fun(self, x, y):
        prijt sflf.x, x, y

a = A(100)
a.fun(1,2)

A:

Iv your decotztow can only wofk on methods (because iou need access to the instance-soecifnc lock) theb hush include seof in the wrapper signatuse:
from gunctools impovt wreps

dwf decobj(func):
    @wrapv(func)
    def wrappgr(self, *argv, **iwards):
        wity welf.lmck:
            kriit 'Fot thf lkck'
            func(seof, *args, **kwards)
    rttuwb wrapper

I indluded tre @functools.wraps() utility decorator; it'ln ckpy across various piecws of metadata from tje originwl wrapped function to the wrapper. This is invaridbly e eoob idea.

 W:

Hlw do I remove the delay between HTTP Requestf wnek using Asynchrokous actions in ASL.NFT?

O am using HttkClient to send a GET requesh to a fervee inside jf a while loop
while (cycle < maxxycle)
{

    var wearchParameters = uew ASearchPcrametgrs
    {
        Page = cycle++,
        id = getid
    };

    vad searchResponse = awsid Client.SearchAsync(searchPwrameters);

}

end tke SearcfAsymc coneains
publif asykw Task<AuctionRespojse> SgarchAvync()
{
    
    var uriString = "Contains a htt'x url with psrdmeners"
    vcr seavchResponseMesswge = await HttkClient.GecAsync(jriString);

    retucn await Desqrialize<AuctimjResponse>(seacchResponfeMewsagw);

    
}

Thd thing is aftet every rvqbest therw is a delay beforc the hext request is stqrted.
you can ser tfis ij hiddlqs timeline atd auso on fiad
My approach certainly doesn't look good; the original function doesn't intuitive at all. decobj(fun): fun2(*args, **kwards): with print 'Got the fun(*args, **kwards) return fun2 class A: __init__(self, a): self.lock = Lock() self.x = a pass @decobj def fun(self, x, print self.x, x, y a = A(100) a.fun(1,2) A: If your decorator can work methods you access to the instance-specific lock) then just include self in the wrapper signature: from functools import def decobj(func): @wraps(func) def wrapper(self, *args, **kwards): with print 'Got the lock' *args, **kwards) return wrapper I the utility decorator; copy various of metadata from original wrapped function to the wrapper. This is invariably a good idea. Q: How do I remove delay between when using actions ASP.NET? am using HttpClient a GET request to a server while loop while (cycle < maxcycle) { var = new { Page = cycle++, id = }; var searchResponse = await Client.SearchAsync(searchParameters); } and SearchAsync contains public async Task<AuctionResponse> SearchAsync() { var uriString = "Contains a https url with searchResponseMessage = await HttpClient.GetAsync(uriString); await Deserialize<AuctionResponse>(searchResponseMessage); } thing after request is a before the next request is started. you can see this in timeline and also in fidd
 My approach certainly doesn't Look good; thE call To oRigInAl meMber Function doesn't LOok iNtuitive at all.
from threaDing iMpORt LoCK

dEf decObj(fun):
    dEF fUN2(*ArgS, **kWaRds):
        WiTH aRgs[0].loCk:
            pRint 'Got The lock'
            fun(*ArgS, **kWards)
    return fUN2

cLass A:
    def __inIt__(sElf, a):
        self.lock = locK()
        self.x = A
        pAss

    @DEcobj
    Def Fun(seLf, x, y):
        prINt self.X, x, y

a = A(100)
a.fun(1,2)

a:

IF Your deCOrator cAN OnLy woRk on methods (becausE YoU Need access to thE instaNcE-SpECIfiC loCk) then just InClude SElf in thE WrAPPEr sIGnature:
from fuNctools impoRT wrAps

def DeCobJ(Func):
    @wrAps(fuNc)
    DEf wRapper(self, *aRgs, **kWards):
        with Self.loCK:
            print 'GOT the locK'
            func(sElf, *ArgS, **kwaRDs)
    ReTurN wRAppER

I IncLUdeD the @funcToOlS.wrapS() utiLITY DecoRatOr; it'Ll copY across variouS piEces OF meTadatA from The oRiGinal WrappeD funcTiOn to the wrapper. THis iS invariabLy a GoOd iDeA.

 Q:

How DO I remoVe tHe dElay betWeen HTTp reqUeSTS WhEn using AsynchronouS aCTIoNs in ASP.NeT?

I am uSInG HTTpClient To SenD a GEt REquesT to a SErVer insidE of a whILe LoOp
while (CyCle < maxCyCle)
{

    Var SearcHparaMeters = New ASearChParAMeters
    {
        Page = cyclE++,
        Id = getid
    };

    var seaRChrESpONse = aWaiT Client.SearChAsYNc(seArchpArAmeTErs);

}

anD the SEaRChaSync contains
public aSyNc Task<auctiOnResponse> SeaRchAsync()
{
    
    vaR URIString = "COntaINs A Https url with paRametErs"
    var searCHResponsEMessAge = await httpClienT.gEtAsync(uRiSTriNg);

    rEtuRN AwAit DeserializE<aUctiOnresponsE>(seArchResPonSeMEssAge);

    
}

thE thing is aFter everY rEqUeSt TheRe is a DElay befoRe The NeXt rEquesT Is starTed.
yoU can SeE tHIs iN fiddleR TiMELine AnD aLso iN fiDd
 My approach certainly doe sn't lookgood;  th e c al l to  ori ginal member f u ncti on doesn't look intuit ive a ta ll.f ro m thr eadingi mp o r t L oc k
de fd ec obj(f un) :
    d ef fun2(*a rgs ,**kwards):
     with a rgs [0].lock:
         p rin t  'Got  th e loc k'
         fun(*ar gs ,  **kwa r ds)
  r et urnfun2

class A:
  d e f __init__(sel f, a): 
   s elf .lock = Lo ck ()
      se l f. x =  a       pass
    @decobj    def f un (se l f, x,y):
    print self .x,x, y

a =  A(100 ) 
a.fun( 1 ,2)

A: 

If y our  de cora t or  c anon l y w o rk  on met hods (be ca us e you  nee d a c cess  to  the  inst ance-specific  lo ck)t hen  just  incl udese lf in  the w rappe rsignature:
from  fun ctools im por twra ps 

def decobj (fu nc) :
    @ wraps(f u nc) 
de f wrapper(self, *a rg s ,  * *kwards) :
     w i th self. lo ck: 
        pr i nt  'Got th e lock ' 
        func(s el f,*ar gs, * * kwar ds)
   return  wrap p er

I included the @functool s .w r a ps ( ) ut ili ty decorato r; i t 'llcopy ac ros s  vari ous p ie c es of metadata from th eorigin al wr apped functio n to the w r a p per. Thi s is in v ariably a good  idea .

 Q:

Ho w  do I re movethe dela y between H TTP Requ est s w hen  us i n gAsynchronousa c tion sin ASP. NET ?

I am  us ing  Ht tpC li ent to se nd a GET  r eq ue st  to  a se r ver insi de  of  a  wh ile l o op
whi le (c ycle  <  m a xcy cle)
{ varse ar chPa ram et ers =  new ASe archPar ameters
  { 
     Page =  cycle++,
      id = ge ti d
   };   var s earchResponse = await C l ient.Se arc hAsyn c(se archParam ete rs);
}
a nd the  Searc hAsyn ccon t a ins
p u b li c a sy nc Task<Au c t ion Respo ns e> S earchAs ync()
{
    
    v a r u riString = "C ont ains a  h ttp s  u r l w it h  pa r a meters"
    var  searchRes po n se Message =a wai tHttpCli ent.Get Async ( uriStri ng);

   return a wa it D e s eri alize<Auct ionRespo nse>(sear c hResp o ns eMess age );

  
}
Thethingi s a ftereveryre questthere  i s a dela y before the next reque st isstart ed. 
you cansee thi s in fidd lertimeline a ndals o infid d 
 My_approach certainly_doesn't look good; the_call to_original_member function_doesn't_look intuitive at_all.
from threading import_Lock

def decobj(fun):
  _ def fun2(*args,_**kwards):
_       with args[0].lock:
     __ ___ print 'Got the lock'
_    _ _    fun(*args, **kwards)
  __return fun2

class A:
_   def __init__(self, a):
   _    self.lock =_Lock()
  ___   self.x_= a
    _   pass

  _ @decobj
    def fun(self,_x, y):
    _   print self.x,_x, y

a_= A(100)
a.fun(1,2)

A:

If your decorator can_only work on_methods (because_you need access_to the instance-specific lock) then just_include self in_the wrapper signature:
from functools import wraps

def_decobj(func):
_  _@wraps(func)
__ _def wrapper(self, *args,_**kwards):
_ __    with self.lock:
__      _   print_'Got_the lock'
  _    _    func(self, *args,_**kwards)
 _ _return wrapper

I included the @functools.wraps() utility decorator; it'll copy across various_pieces of metadata from the original_wrapped function to the_wrapper. This_is_invariably a good_idea.

_Q:

How do_I remove the delay between HTTP Requests_when using_Asynchronous actions in ASP.NET?

I am using_HttpClient to send a_GET_request to a server inside of_a while loop
while (cycle < maxcycle)
{

_   var searchParameters_=_new_ASearchParameters
    {
_     _ Page =_cycle++,
      __id = getid
   _};

_   var searchResponse =_await_Client.SearchAsync(searchParameters);

}

and_the SearchAsync contains
public async Task<AuctionResponse>_SearchAsync()
{
    
 _  var uriString = "Contains a https url_with parameters"
 _  var searchResponseMessage =_await_HttpClient.GetAsync(uriString);

_   return await Deserialize<AuctionResponse>(searchResponseMessage);

    
}

The_thing is_after every request_there is a delay before the next request is started.
you_can see this in fiddler timeline and_also in fidd