MCPcopy Create free account
hub / github.com/akshayganeshen/napi-go / insert

Method insert

instance_data.go:451–475  ·  view source on GitHub ↗
(
	execute AsyncExecuteCallback,
	complete AsyncCompleteCallback,
)

Source from the content-addressed store, hash-verified

449}
450
451func (d *NapiGoInstanceAsyncWorkData) insert(
452 execute AsyncExecuteCallback,
453 complete AsyncCompleteCallback,
454) *NapiGoAsyncWorkMapEntry {
455 // callers are expected to lock
456
457 if d.AsyncWorkMap == nil {
458 d.AsyncWorkMap = NapiGoInstanceAsyncWorkMap{}
459 }
460
461 for {
462 id := d.NextID
463 d.NextID++
464
465 if d.AsyncWorkMap[id] == nil {
466 result := &NapiGoAsyncWorkMapEntry{
467 Execute: execute,
468 Complete: complete,
469 ID: id,
470 }
471 d.AsyncWorkMap[id] = result
472 return result
473 }
474 }
475}

Callers 1

CreateAsyncWorkMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected