Concurrency Patterns in CArtsiom Bukhautsou Senior Backend Engineer @Nord SecurityFan-out 🌱 Pipeline 🤔 Fan-in, Fan-out, Pipeline 🦾 Agenda Fan-in 🌱 Tee 🌱 1. 2. 3. 4. 5.Why learn these patterns?Fan-inFan-in Pros - Simplifies Stage latency accumulation Use cases - ETL processes - Multimedia processingPipeline (Example)Fan-in, Fan-out, PipelineFan-in, Fan-out, Pipeline Pros - Maximized throughput - Scalable architecture0 码力 | 20 页 | 1.35 MB | 6 月前3
Go Context原理及其典型适用场景大纲 Channel Fan-in func fanIn(sum1, sum2 <-chan int) <-chan int { sum := make(chan int) go func() { for {sum <- <-sum1} }() go func() { for {sum <- <-sum2} }() return sum } Fan-in Chan Chan Chan Fan-in func main() { sum := fanIn(add(1, 2), add(4, 9)) fmt.Println(<-sum) fmt.Println(<-sum) } Select func fanIn(sum1, sum2 <-chan int) <-chan int { sum := make(chan int) go func() { for0 码力 | 32 页 | 4.62 MB | 1 年前3
Go 2 Generics? A (P)review试试写个 append()? 2020 © Changkun Ou · Go 夜读 · Go 2 Generics? A (P)review Example 5: Fan-in Fan-out 30 1 // generic fan-in -- by changkun 2 func Fanin(type T)(ins ...<-chan T) <-chan T { 3 buf := 00 码力 | 41 页 | 770.62 KB | 1 年前3
7 Years of Talking to People: The Importance of Giving Talks in Golang Warsaw #59Deadlines, Cancellation, and Timeouts" 7. "Advanced Channel Patterns in Go: Pipeline, Fan-Out, and Fan-In" 8. "Understanding Go's Package Structure and Module System" 9. "Effective Use of Reflection in0 码力 | 26 页 | 3.20 MB | 6 月前3
Kotlin 1.2 Language Documentationiteration over channels Building channel producers Pipelines Prime numbers with pipeline Fan-out Fan-in Buffered channels Channels are fair Ticker channels Deferred values provide a convenient way (in this example we launch them in the context of the main thread as main coroutine's children): Fan-in 262 fun main(args: Array) = runBlocking { val channel = Channel () launch 0 码力 | 333 页 | 2.22 MB | 1 年前3
Kotlin Language Documentation 1.3iteration over channels Building channel producers Pipelines Prime numbers with pipeline Fan-out Fan-in Bu�ered channels Channels are fair Ticker channels Deferred values provide a convenient way to s: String, time: Long) { while (true) { delay(time) channel.send(s) } } Fan-in 494 Now, let us see what happens if we launch a couple of coroutines sending strings (in this example0 码力 | 597 页 | 3.61 MB | 1 年前3
The Vitess 6.0 DocumentationIf there is no CA specified then TLS is optional. Session Scope Vitess uses a connection pool to fan-in connections from VTGate servers to Tablet servers. VTGate servers will refuse statements that make0 码力 | 210 页 | 846.79 KB | 1 年前3
The Vitess 5.0 Documentationthere is no CA specified then TLS is optional. 52 Session Scope Vitess uses a connection pool to fan-in connections from VTGate servers to Tablet servers. VTGate servers will refuse statements that make0 码力 | 206 页 | 875.06 KB | 1 年前3
The Vitess 7.0 DocumentationIf there is no CA specified then TLS is optional. Session Scope Vitess uses a connection pool to fan-in connections from VTGate servers to Tablet servers. VTGate servers will refuse statements that make0 码力 | 254 页 | 949.63 KB | 1 年前3
Go 101 (Golang 101) v1.21.0From the last example, we can find that, with the help of aggregators, it is easy to implement fan-in and fan-out for the number of workers for a specified module. In fact, we can use a simple channel0 码力 | 610 页 | 945.17 KB | 1 年前3
共 16 条
- 1
- 2













