{"push_id":555734432,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"8b5baa68690654c7186b9997ed731e05dfcd4911","before":"52f3f04eb1cedb948b693f229a04c75e6a94f1fe","commits":[{"sha":"8b5baa68690654c7186b9997ed731e05dfcd4911","author":{"email":"16b0f016d4fa1d92b0ae711ca82b11715b29674f@gmail.com","name":"Michael Santos"},"message":"poll/1,2: flush mailbox for read_write\n\nSince read and write are separate messages, it's possible that the\nmailbox will have both if read_write mode is requested. There are a few\nways this could be handled:\n\n* return the first received message, leave the other message queued\n\n  A subsequent call to poll will return immediately.\n\n* return the first received message, drop any other queued messages\n\n  This is the way poll with read_write mode acts today when a timeout is\n  hit.\n\n* check for both messages and, if present, return read_write.\n\nOption 1 is racy: Who knows what will happen to the fd between one call\nto poll and the next. But it should be harmless since poll does not act\ndirectly on the fd, i.e., the library that directly manipulates the fd\nwill receive the error (probably {error,eagain}).\n\nOption 3 might be the way to go but adds some overhead:\n\n    case inert:poll(1, [{mode,read_write}]) of\n        {ok, read} -> do_read(1);\n        {ok, write} -> do_write(1);\n        {ok, read_write} -> do_read(1), do_write(1)\n    end.\n\nSince option 2 is the way poll handles timeouts today, re-use the same\ncode for the non-timeout case.","distinct":true,"url":"https://api.github.com/repos/msantos/inert/commits/8b5baa68690654c7186b9997ed731e05dfcd4911"}]}