func (t *Tube) Write(key string, rev Rev, value interface{}) (changed bool) {
	// log.Printf("tube writing (%s,%d,%v)", key, rev, value)
	// defer func() {
	// 	log.Printf("tube wrote, changed=%v\n%s", changed, t.Dump())
	// }()

	t.Lock()
	defer t.Unlock()
	//
	changed = t.write(&Record{
		Key:     key,
		Rev:     rev,
		Value:   value,
		Updated: time.Now(),
	})
	//
	if changed {
		go t.writeSync(key, rev, value)
	}
	return
}
// The first write must have revision bigger than 0. Otherwise it won't take effect.
// Write will block until the diffusion of the write operation reaches its terminal nodes.
// This simple form of backpressure ensures self-inflicted DDoS in the presence of software bugs.
The first write must have revision bigger than 0. Otherwise it won't take effect.
Write will block until the diffusion of the write operation reaches its terminal nodes.
This simple form of backpressure ensures self-inflicted DDoS in the presence of software bugs.
// The first write must have revision bigger than 0 . Otherwise it won ' t take effect . // Write will block until the diffusion of the write operation reaches its terminal nodes . // This simple form of backpressure ensures self - inflicted DDoS in the presence of software bugs .
func (t *Tube) Write(key string, rev Rev, value interface{}) (changed bool) {
	t.Lock()
	defer t.Unlock()
	changed = t.write(&Record{
		Key:     key,
		Rev:     rev,
		Value:   value,
		Updated: time.Now(),
	})
	if changed {
		go t.writeSync(key, rev, value)
	}
	return
}
func ( t * Tube ) Write ( key string , rev Rev , value interface { } ) ( changed bool ) { t . Lock ( ) defer t . Unlock ( ) changed = t . write ( & Record { Key : key , Rev : rev , Value : value , Updated : time . Now ( ) , } ) if changed { go t . writeSync ( key , rev , value ) } return }
The first write must have revision bigger than 0.
The first write must have revision bigger than 0 .
// log.Printf("tube writing (%s,%d,%v)", key, rev, value) // defer func() { // 	log.Printf("tube wrote, changed=%v\n%s", changed, t.Dump()) // }() // //