Ipc::Forwarder::Forwarder(Request::Pointer aRequest, double aTimeout):
AsyncJob("Ipc::Forwarder"),
+ codeContext(CodeContext::Current()),
request(aRequest), timeout(aTimeout)
{
}
Must(param != NULL);
Forwarder* fwdr = static_cast<Forwarder*>(param);
// use async call to enable job call protection that time events lack
- CallJobHere(54, 5, fwdr, Forwarder, requestTimedOut);
+
+ CallBack(fwdr->codeContext, [&fwdr] {
+ CallJobHere(54, 5, fwdr, Forwarder, requestTimedOut);
+ });
}
/// called when Coordinator fails to start processing the request [in time]
#define SQUID_IPC_FORWARDER_H
#include "base/AsyncJob.h"
+#include "base/forward.h"
#include "cbdata.h"
#include "ipc/Request.h"
#include "mgr/ActionParams.h"
/* has-to-be-public AsyncJob API */
virtual void callException(const std::exception& e);
+ CodeContextPointer codeContext;
+
protected:
/* AsyncJob API */
virtual void start();
Ipc::Inquirer::Inquirer(Request::Pointer aRequest, const StrandCoords& coords,
double aTimeout):
AsyncJob("Ipc::Inquirer"),
+ codeContext(CodeContext::Current()),
request(aRequest), strands(coords), pos(strands.begin()), timeout(aTimeout)
{
debugs(54, 5, HERE);
Must(param != NULL);
Inquirer* cmi = static_cast<Inquirer*>(param);
// use async call to enable job call protection that time events lack
- CallJobHere(54, 5, cmi, Inquirer, requestTimedOut);
+ CallBack(cmi->codeContext, [&cmi] {
+ CallJobHere(54, 5, cmi, Inquirer, requestTimedOut);
+ });
}
/// called when the strand failed to respond (or finish responding) in time
#include "base/AsyncJob.h"
#include "base/AsyncJobCalls.h"
+#include "base/forward.h"
#include "ipc/forward.h"
#include "ipc/Request.h"
#include "ipc/Response.h"
/* has-to-be-public AsyncJob API */
virtual void callException(const std::exception& e);
+ CodeContextPointer codeContext;
+
protected:
/* AsyncJob API */
virtual void start();
Ipc::UdsSender::UdsSender(const String& pathAddr, const TypedMsgHdr& aMessage):
UdsOp(pathAddr),
+ codeContext(CodeContext::Current()),
message(aMessage),
retries(10), // TODO: make configurable?
timeout(10), // TODO: make configurable?
Pointer *ptr = static_cast<Pointer*>(data);
assert(ptr);
if (UdsSender *us = dynamic_cast<UdsSender*>(ptr->valid())) {
- // get back inside AsyncJob protection by scheduling an async job call
- typedef NullaryMemFunT<Ipc::UdsSender> Dialer;
- AsyncCall::Pointer call = JobCallback(54, 4, Dialer, us, Ipc::UdsSender::delayedRetry);
- ScheduleCallHere(call);
+ CallBack(us->codeContext, [&us] {
+ CallJobHere(54, 4, us, UdsSender, delayedRetry);
+ });
}
delete ptr;
}
#define SQUID_IPC_ASYNCUDSOP_H
#include "base/AsyncJob.h"
+#include "base/forward.h"
#include "cbdata.h"
#include "comm/forward.h"
#include "ipc/FdNotes.h"
public:
UdsSender(const String& pathAddr, const TypedMsgHdr& aMessage);
+ CodeContextPointer codeContext;
+
protected:
virtual void swanSong(); // UdsOp (AsyncJob) API
virtual void start(); // UdsOp (AsyncJob) API