The unpac monorepo manager self-hosting as a monorepo using unpac
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #67 from talex5/rename-peek

Rename peek to get_cqe_nonblocking

authored by

Thomas Leonard and committed by
GitHub
4a759a40 f518db89

+13 -7
+1 -1
bench/readv.ml
··· 6 6 let n_iters = 1_000_000 (* How many times to accept and resubmit *) 7 7 8 8 let rec wait t handle = 9 - match Uring.peek t with 9 + match Uring.get_cqe_nonblocking t with 10 10 | Some { result; data = buf } -> handle result buf 11 11 | None -> 12 12 match Uring.wait t with
+3 -1
lib/uring/uring.ml
··· 474 474 let data = Heap.free t.data user_data_id in 475 475 Some { result = res; data } 476 476 477 - let peek t = 477 + let get_cqe_nonblocking t = 478 478 gc_sketch t; 479 479 fn_on_ring Uring.peek_cqe t 480 + 481 + let peek = get_cqe_nonblocking 480 482 481 483 let wait ?timeout t = 482 484 let r =
+7 -3
lib/uring/uring.mli
··· 282 282 283 283 val wait : ?timeout:float -> 'a t -> 'a completion_option 284 284 (** [wait ?timeout t] will block indefinitely (the default) or for [timeout] 285 - seconds for any outstanding events to complete on uring [t]. Events should 286 - have been queued via {!submit} previously to this call. *) 285 + seconds for any outstanding events to complete on uring [t]. 286 + This calls {!submit} automatically. *) 287 + 288 + val get_cqe_nonblocking : 'a t -> 'a completion_option 289 + (** [get_cqe_nonblocking t] returns the next completion entry from the uring [t]. 290 + It is like {!wait} except that it returns [None] instead of blocking. *) 287 291 288 292 val peek : 'a t -> 'a completion_option 289 - (** [peek t] looks for completed requests on the uring [t] without blocking. *) 293 + [@@deprecated "Renamed to Uring.get_cqe_nonblocking"] 290 294 291 295 val error_of_errno : int -> Unix.error 292 296 (** [error_of_errno e] converts the error code [abs e] to a Unix error type. *)
+1 -1
tests/urcp_fixed_lib.ml
··· 135 135 let got_completion = ref false in 136 136 let rec handle_completions () = 137 137 if t.write_left > 0 then begin 138 - let check_q = if !got_completion then Uring.peek uring else Uring.wait uring in 138 + let check_q = if !got_completion then Uring.get_cqe_nonblocking uring else Uring.wait uring in 139 139 match check_q with 140 140 |None -> Logs.debug (fun l -> l "completions: retry so finishing loop") 141 141 |Some { data; result } ->
+1 -1
tests/urcp_lib.ml
··· 140 140 let got_completion = ref false in 141 141 let rec handle_completions () = 142 142 if t.write_left > 0 then begin 143 - let check_q = if !got_completion then Uring.peek uring else Uring.wait uring in 143 + let check_q = if !got_completion then Uring.get_cqe_nonblocking uring else Uring.wait uring in 144 144 match check_q with 145 145 |None -> Logs.debug (fun l -> l "completions: retry so finishing loop") 146 146 |Some { data; result } ->