Go - unidirectional channel


  • Send only: chan<- int
  • Receive only: <-chan int
  • Violation will compile error
  • Only channel used to send msg need to be closed, so to close a receive only channel will compile error
  • A channel can be passed as an unidirectional channel. So that can be foced to use it correctly in function.
  • Can convert a bidirectional channel to unidirectional, but not vice versa


沒有留言:

張貼留言

Lessons Learned While Benchmarking vLLM with GPU

Recently, I benchmarked vLLM on a GPU to better understand how much throughput can realistically be expected in an LLM serving setup. One ...