MCPcopy
hub / github.com/ha/doozerd / Wait

Method Wait

src/pkg/store/store.go:333–350  ·  view source on GitHub ↗

Returns a chan that will receive a single event representing the first change made to any file matching glob on or after rev. If rev is less than any value passed to st.Clean, Wait will return ErrTooLate.

(glob *Glob, rev int64)

Source from the content-addressed store, hash-verified

331// If rev is less than any value passed to st.Clean, Wait will return
332// ErrTooLate.
333func (st *Store) Wait(glob *Glob, rev int64) (<-chan Event, os.Error) {
334 if rev < 1 {
335 rev = 1
336 }
337
338 ch := make(chan Event, 1)
339 wt := &watch{
340 glob: glob,
341 rev: rev,
342 c: ch,
343 }
344 st.watchCh <- wt
345
346 if rev < st.head {
347 return nil, ErrTooLate
348 }
349 return ch, nil
350}
351
352
353func (st *Store) Clean(seqn int64) {

Callers 15

TestMemberSimpleFunction · 0.80
waitForFunction · 0.80
TestDoozerWaitSimpleFunction · 0.80
TestDoozerWaitWithRevFunction · 0.80
ProposeMethod · 0.80
MainFunction · 0.80
activateFunction · 0.80
followFunction · 0.80
TestGcCleanFunction · 0.80
syncFunction · 0.80
TestWaitGlobOnPreFunction · 0.80
TestWaitGlobAfterPreFunction · 0.80

Calls

no outgoing calls

Tested by 15

TestMemberSimpleFunction · 0.64
waitForFunction · 0.64
TestDoozerWaitSimpleFunction · 0.64
TestDoozerWaitWithRevFunction · 0.64
TestGcCleanFunction · 0.64
syncFunction · 0.64
TestWaitGlobOnPreFunction · 0.64
TestWaitGlobAfterPreFunction · 0.64
TestWaitGlobOnPostFunction · 0.64
TestWaitGlobAfterPostFunction · 0.64
TestStoreNopEventFunction · 0.64
TestStoreNoEventsOnFlushFunction · 0.64