Synchronizing all events to better handle epoch change

Following are the events to be synchronized:
- [x] epoch change
- [x] meta (from parent or child) change
- [x] data request to send
- [x] data request received
- [x] data response to send
- [x] data response received

As a next step on this work, it needs:
1. send http response back for epoch discrepancy.

Once that's finished, we can do random failure test on Task#ChildDataReady.
You can start fixing these two, it will take a bit for me go through your
pr.

Xiaoyun

On Mon, Dec 22, 2014 at 4:28 PM, Hongchao Deng <notifications@github.com>
wrote:

> In framework/bootstrap.go
> <https://github.com/go-distributed/meritop/pull/101#discussion-diff-22198965>
> :
>
> >
> > -	defer f.releaseResource()
> > +	f.eventloop()
> > +	f.releaseResource()
> > +}
> > +
> > +func (f *framework) eventloop() {
> > +	f.metaChan = make(chan *metaChange, 100)
> > +	f.dataReqtoSendChan = make(chan *dataRequest, 100)
> > +	f.dataReqChan = make(chan *dataRequest, 100)
> > +	f.dataRespToSendChan = make(chan *dataRequest, 100)
> > +	f.dataRespChan = make(chan *dataResponse, 100)
> > +
> > +	// from this point the task will start doing work
> > +	f.task.Init(f.taskID, f)
>
> Do you have any suggestion?
> I don't mind any change to make the code look better.
> Otherwise I will focus on fixing the standby and http response for epoch
> discrepancy.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/go-distributed/meritop/pull/101/files#r22198965>.
>