refactor receive() code out of query() so it can be used with notifications
refactor receive() code out of query() so it can be used with notifications

Summary:
this is a change to upstream third-party source, and should
be submitted for inclusion.

Test Plan: I have an application which uses this, and it works.

Reviewers: sid0, wez

Reviewed By: wez

Differential Revision: https://reviews.facebook.net/D28641

kevinsawicki/watchman,webmasteraxe/watchman,besarthoxhaj/watchman,michalliu/watchman,yun63/watchman,yun63/watchman,phmx/watchman,Jonekee/watchman,exponentjs/watchman,montogeek/watchman,yangeagle/watchman,Jonekee/watchman,Jonekee/watchman,hanhailong/watchman,nodakai/watchman,yangeagle/watchman,alanwill/watchman,michalliu/watchman,twitter/watchman,supriyantomaftuh/watchman,yangeagle/watchman,bitemyapp/watchman,bhamiltoncx/watchman,twitter/watchman,alanwill/watchman,montogeek/watchman,nodakai/watchman,bitemyapp/watchman,windofthesky/watchman,nodakai/watchman,wez/watchman,besarthoxhaj/watchman,montogeek/watchman,wez/watchman,alanwill/watchman,Ziriax/watchman,dcolascione/laptop-watchman,besarthoxhaj/watchman,bhamiltoncx/watchman,michalliu/watchman,masoncloud/watchman,wez/watchman,phmx/watchman,Ziriax/watchman,michalliu/watchman,facebook/watchman,bitemyapp/watchman,sdgdsffdsfff/watchman,besarthoxhaj/watchman,masoncloud/watchman,dcolascione/laptop-watchman,windofthesky/watchman,webmasteraxe/watchman,facebook/watchman,masoncloud/watchman,dhruvsinghal/watchman,yangeagle/watchman,yonglehou/watchman,michalliu/watchman,Jonekee/watchman,Jonekee/watchman,yangeagle/watchman,kevinsawicki/watchman,sdgdsffdsfff/watchman,bitemyapp/watchman,twitter/watchman,masoncloud/watchman,supriyantomaftuh/watchman,yangeagle/watchman,bhamiltoncx/watchman,michalliu/watchman,hanhailong/watchman,dhruvsinghal/watchman,supriyantomaftuh/watchman,twitter/watchman,phmx/watchman,besarthoxhaj/watchman,exponentjs/watchman,facebook/watchman,yun63/watchman,wez/watchman,amasad/watchman,nodakai/watchman,kevinsawicki/watchman,phmx/watchman,webmasteraxe/watchman,yun63/watchman,nodakai/watchman,kevinsawicki/watchman,dhruvsinghal/watchman,webmasteraxe/watchman,bhamiltoncx/watchman,yun63/watchman,yonglehou/watchman,sdgdsffdsfff/watchman,kwlzn/watchman,hanhailong/watchman,webmasteraxe/watchman,masoncloud/watchman,yangeagle/watchman,windofthesky/watchman,hanhailong/watchman,montogeek/watchman,exponentjs/watchman,twitter/watchman,windofthesky/watchman,hanhailong/watchman,alanwill/watchman,dhruvsinghal/watchman,dhruvsinghal/watchman,alanwill/watchman,supriyantomaftuh/watchman,kwlzn/watchman,sdgdsffdsfff/watchman,exponentjs/watchman,besarthoxhaj/watchman,dhruvsinghal/watchman,Ziriax/watchman,yonglehou/watchman,hanhailong/watchman,sdgdsffdsfff/watchman,masoncloud/watchman,nodakai/watchman,kevinsawicki/watchman,kwlzn/watchman,yun63/watchman,facebook/watchman,supriyantomaftuh/watchman,kwlzn/watchman,exponentjs/watchman,Ziriax/watchman,dhruvsinghal/watchman,bhamiltoncx/watchman,wez/watchman,yun63/watchman,besarthoxhaj/watchman,amasad/watchman,supriyantomaftuh/watchman,supriyantomaftuh/watchman,Ziriax/watchman,yonglehou/watchman,Jonekee/watchman,wez/watchman,bitemyapp/watchman,exponentjs/watchman,yonglehou/watchman,dcolascione/laptop-watchman,michalliu/watchman,webmasteraxe/watchman,phmx/watchman,besarthoxhaj/watchman,dcolascione/laptop-watchman,yonglehou/watchman,Jonekee/watchman,amasad/watchman,supriyantomaftuh/watchman,amasad/watchman,montogeek/watchman,kevinsawicki/watchman,masoncloud/watchman,kwlzn/watchman,twitter/watchman,nodakai/watchman,sdgdsffdsfff/watchman,bitemyapp/watchman,bhamiltoncx/watchman,webmasteraxe/watchman,twitter/watchman,amasad/watchman,amasad/watchman,kevinsawicki/watchman,kwlzn/watchman,hanhailong/watchman,hanhailong/watchman,yun63/watchman,sdgdsffdsfff/watchman,masoncloud/watchman,michalliu/watchman,amasad/watchman,nodakai/watchman,wez/watchman,twitter/watchman,facebook/watchman,Ziriax/watchman,yonglehou/watchman,dcolascione/laptop-watchman,yonglehou/watchman,dhruvsinghal/watchman,phmx/watchman,wez/watchman,dcolascione/laptop-watchman,windofthesky/watchman,bitemyapp/watchman,facebook/watchman,montogeek/watchman,dcolascione/laptop-watchman,bitemyapp/watchman,amasad/watchman,kwlzn/watchman,sdgdsffdsfff/watchman,Jonekee/watchman,nodakai/watchman,windofthesky/watchman,webmasteraxe/watchman,facebook/watchman,facebook/watchman,windofthesky/watchman,facebook/watchman,dcolascione/laptop-watchman,wez/watchman,montogeek/watchman,montogeek/watchman,alanwill/watchman