github.com/haraldrudell/parl@v0.4.176/if-send.go (about) 1 /* 2 © 2024–present Harald Rudell <harald.rudell@gmail.com> (https://haraldrudell.github.io/haraldrudell/) 3 ISC License 4 */ 5 6 package parl 7 8 // Send declares an object with a Send method 9 // - the Send interface is similar to a callback function value 10 // - — passing a method as function value causes allocation 11 // - — such function values create difficult-to-follow stack traces 12 // - the Send interface is implemented by eg. [github.com/haraldrudell/parl.NBChan] 13 // - Send is intended to provide a trouble-free value sink 14 // transferring data to other threads 15 type Send[T any] interface { 16 // Send is typically a thread-safe non-blocking panic-free error-free 17 // send hand-off of a single value to another thread implemented as a method 18 // - Send replaces Go channel send operation 19 Send(value T) 20 }