MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / buffer_write

Method buffer_write

nodedb/src/control/server/pgwire/session/transaction.rs:135–145  ·  view source on GitHub ↗

Buffer a write task during a transaction block. Returns `true` if buffered (in transaction), `false` if not (dispatch immediately).

(&self, addr: &SocketAddr, task: PhysicalTask)

Source from the content-addressed store, hash-verified

133 ///
134 /// Returns `true` if buffered (in transaction), `false` if not (dispatch immediately).
135 pub fn buffer_write(&self, addr: &SocketAddr, task: PhysicalTask) -> bool {
136 self.write_session(addr, |session| {
137 if session.tx_state == TransactionState::InBlock {
138 session.tx_buffer.push(task);
139 true
140 } else {
141 false
142 }
143 })
144 .unwrap_or(false)
145 }
146
147 /// ROLLBACK — discard the write buffer and return to idle.
148 /// Returns any pending GAP_FREE reservations that need to be rolled back.

Callers 2

dispatch_task_loopMethod · 0.80
execute_plannedFunction · 0.80

Calls 2

write_sessionMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected