MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / aeCreateRemoteFileEvent

Function aeCreateRemoteFileEvent

src/ae.cpp:229–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227}
228
229int aeCreateRemoteFileEvent(aeEventLoop *eventLoop, int fd, int mask,
230 aeFileProc *proc, void *clientData)
231{
232 if (eventLoop == g_eventLoopThisThread)
233 return aeCreateFileEvent(eventLoop, fd, mask, proc, clientData);
234
235 int ret = AE_OK;
236
237 aeCommand cmd;
238 cmd.op = AE_ASYNC_OP::CreateFileEvent;
239 cmd.fd = fd;
240 cmd.mask = mask;
241 cmd.fproc = proc;
242 cmd.clientData = clientData;
243 cmd.fLock = true;
244
245 auto size = safe_write(eventLoop->fdCmdWrite, &cmd, sizeof(cmd));
246 if (size != sizeof(cmd))
247 {
248 serverAssert(size == sizeof(cmd) || size <= 0);
249 serverAssert(errno == EAGAIN);
250 ret = AE_ERR;
251 }
252
253 return ret;
254}
255
256int aePostFunction(aeEventLoop *eventLoop, aePostFunctionProc *proc, void *arg)
257{

Callers

nothing calls this directly

Calls 2

aeCreateFileEventFunction · 0.85
safe_writeFunction · 0.70

Tested by

no test coverage detected