github.com/ii64/gouring@v0.4.1/README.md (about)

     1  # gouring
     2  
     3  [![License: MIT][1]](LICENSE)
     4  [![Go Reference][2]][3]
     5  
     6  
     7  ```bash
     8  go get github.com/ii64/gouring
     9  ```
    10  ## Example
    11  
    12  ```go
    13  // setup
    14  h, err := gouring.New(256, 0)
    15  if err != nil { /*...*/ }
    16  defer h.Close() 
    17  
    18  sqe := h.GetSQE()
    19  b := []byte("io_uring!\n")
    20  PrepWrite(sqe, 1, &b[0], len(b), 0)
    21  
    22  submitted, err := h.SubmitAndWait(1)
    23  if err != nil { /*...*/ }
    24  println(submitted) // 1
    25  
    26  var cqe *gouring.IoUringCqe
    27  err = h.WaitCqe(&cqe) 
    28  if err != nil { /*...*/ } // check also EINTR
    29  
    30  _ = cqe.UserData
    31  _ = cqe.Res
    32  _ = cqe.Flags
    33  ```
    34  
    35  ## Graph
    36  
    37  | SQPOLL | non-SQPOLL |
    38  | ------ | ---------- |
    39  | ![sqpoll_fig][sqpoll_fig] | ![nonsqpoll_fig][nonsqpoll_fig] |
    40  
    41  ### Reference
    42  
    43  https://github.com/axboe/liburing
    44  
    45  [1]: https://img.shields.io/badge/License-MIT-yellow.svg
    46  [2]: https://pkg.go.dev/badge/github.com/ii64/gouring.svg
    47  [3]: https://pkg.go.dev/github.com/ii64/gouring
    48  [sqpoll_fig]: assets/sqpoll.svg
    49  [nonsqpoll_fig]: assets/nonsqpoll.svg