Framework: DataRequest implementation

Agree on this.
2014年11月19日 下午2:12于 "Hongchao Deng" <notifications@github.com>写道：

> In framework.go:
>
> > @@ -155,6 +207,36 @@ func (f *framework) watchAll(who string, taskIDs []uint64) []chan bool {
> >  }
> >
> >  func (f *framework) DataRequest(toID uint64, req string) {
> > +	// getAddressFromTaskID
> > +	addr, ok := f.addressMap[toID]
> > +	if !ok {
> > +		log.Printf("ID = %d not found", toID)
> > +		return
> > +	}
> > +	// send request
> > +	// throw the future into the event loop waiting for responses
> > +	url := fmt.Sprintf("http://%s%s", addr,
> > +		// it passes self taskID in url to tell the other side
> > +		MakeDataRequestPath(f.taskID, req))
> > +	go func(url string) {
>
> DataRequest shouldn't be blocked.
>
>    1. DataRequest will trigger ServeAsParent on another task.
>    2. after getting the data back, framework calls ParentDataReady.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/go-distributed/meritop/pull/36/files#r20559225>.
>