Standard library / net/textproto

textproto.Pipeline.StartRequest()

Wait for the sequence ID to become eligible to send a request. Pair with EndRequest to release the next request. Expected stdout: '0\n'.

Formal Syntax & Structure

go syntaxgo
func (p *Pipeline) StartRequest(id uint)

Parameters & Attributes

NameTypeDescription
iduintSequence ID allocated by Pipeline.Next.

Working Example

Example Snippetgo
package main
import (  "fmt"  "net/textproto")
func main() {  var p textproto.Pipeline  id := p.Next()  p.StartRequest(id)  p.EndRequest(id)  p.StartResponse(id)  p.EndResponse(id)  fmt.Println(id)}
func must[T any](v T, e error) T {  if e != nil {    panic(e)  }  return v}func check(e error) {  if e != nil {    panic(e)  }}
Go Reference