Skip to content

Commit b5b5de7

Browse files
authored
Merge pull request #508 from talex5/cleanup
Deprecation cleanups
2 parents 7ea93f2 + bc16038 commit b5b5de7

File tree

14 files changed

+18
-73
lines changed

14 files changed

+18
-73
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1875,4 +1875,4 @@ Some background about the effects system can be found in:
18751875
[kcas]: https://github.com/ocaml-multicore/kcas
18761876
[Meio]: https://github.com/tarides/meio
18771877
[Lambda Capabilities]: https://roscidus.com/blog/blog/2023/04/26/lambda-capabilities/
1878-
[Eio.Process]: https://github.com/ocaml-multicore/eio/blob/main/lib_eio/process.ml
1878+
[Eio.Process]: https://github.com/ocaml-multicore/eio/blob/main/lib_eio/process.mli

lib_eio/core/eio__core.mli

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -235,14 +235,7 @@ module Fiber : sig
235235
The calling fiber is placed at the head of the run queue, ahead of any previous items. *)
236236

237237
val fork_sub : sw:Switch.t -> on_error:(exn -> unit) -> (Switch.t -> unit) -> unit
238-
(** [fork_sub ~sw ~on_error fn] is like [fork], but it creates a new sub-switch for the fiber.
239-
240-
This means that you can cancel the child switch without cancelling the parent.
241-
This is a convenience function for running {!Switch.run} inside a {!fork}.
242-
243-
@param on_error This is called if the fiber raises an exception.
244-
If it raises in turn, the parent switch is failed.
245-
It is not called if the parent [sw] itself is cancelled. *)
238+
[@@deprecated "Use Fiber.fork and Switch.run separately instead"]
246239

247240
val fork_promise : sw:Switch.t -> (unit -> 'a) -> 'a Promise.or_exn
248241
(** [fork_promise ~sw fn] schedules [fn ()] to run in a new fiber and returns a promise for its result.
@@ -330,18 +323,6 @@ module Fiber : sig
330323
@param max_fibers Maximum number of fibers to run concurrently *)
331324
end
332325

333-
val filter : ?max_fibers:int -> ('a -> bool) -> 'a list -> 'a list
334-
[@@ocaml.deprecated "Use `Eio.Fiber.List.filter` instead."]
335-
336-
val map : ?max_fibers:int -> ('a -> 'b) -> 'a list -> 'b list
337-
[@@ocaml.deprecated "Use `Eio.Fiber.List.map instead."]
338-
339-
val filter_map : ?max_fibers:int -> ('a -> 'b option) -> 'a list -> 'b list
340-
[@@ocaml.deprecated "Use `Eio.Fiber.List.filter_map instead."]
341-
342-
val iter : ?max_fibers:int -> ('a -> unit) -> 'a list -> unit
343-
[@@ocaml.deprecated "Use `Eio.Fiber.List.iter instead."]
344-
345326
(** {2 Fiber-local variables}
346327
347328
Each fiber maintains a map of additional variables associated with it,

lib_eio/core/fiber.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,6 @@ module List = struct
271271

272272
end
273273

274-
include List
275-
276274
type 'a key = 'a Hmap.key
277275

278276
let create_key () = Hmap.Key.create ()

lib_eio/eio.ml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
include Eio__core
22

3-
module Fibre = Fiber
4-
53
module Debug = Private.Debug
64
let traceln = Debug.traceln
75

86
module Std = struct
97
module Promise = Promise
108
module Fiber = Fiber
11-
module Fibre = Fiber
129
module Switch = Switch
1310
let traceln = Debug.traceln
1411
end

lib_eio/eio.mli

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ module Promise = Eio__core.Promise
2424
(** A fiber is a light-weight thread. *)
2525
module Fiber = Eio__core.Fiber
2626

27-
(**/**)
28-
module Fibre = Fiber [@@deprecated "Now spelt Fiber"]
29-
(**/**)
30-
3127
(** A counting semaphore. *)
3228
module Semaphore = Semaphore
3329

@@ -47,9 +43,6 @@ module Cancel = Eio__core.Cancel
4743
module Std : sig
4844
module Promise = Promise
4945
module Fiber = Fiber
50-
(**/**)
51-
module Fibre = Fiber [@@deprecated "Now spelt Fiber"]
52-
(**/**)
5346
module Switch = Switch
5447

5548
val traceln :

lib_eio/flow.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,5 +107,3 @@ class virtual two_way = object (_ : <source; sink; ..>)
107107
end
108108

109109
let shutdown (t : #two_way) = t#shutdown
110-
111-
let read = single_read

lib_eio/flow.mli

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ class virtual source : object
1515
method virtual read_into : Cstruct.t -> int
1616
end
1717

18-
val read : #source -> Cstruct.t -> int
19-
[@@deprecated "Use single_read if you really want this."]
20-
2118
val single_read : #source -> Cstruct.t -> int
2219
(** [single_read src buf] reads one or more bytes into [buf].
2320

lib_eio/fs.ml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
(** Defines types used by file-systems. *)
22

3-
(** Tranditional Unix permissions. *)
4-
module Unix_perm = File.Unix_perm [@@deprecated "Moved to File.Unix_perm"]
5-
63
type path = string
74

85
type error =

lib_eio/net.ml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,6 @@ let accept_fork ~sw (t : #listening_socket) ~on_error handle =
188188
)
189189
)
190190

191-
let accept_sub ~sw (t : #listening_socket) ~on_error handle =
192-
accept_fork ~sw t ~on_error (fun flow addr -> Switch.run (fun sw -> handle ~sw flow addr))
193-
194191
class virtual datagram_socket = object
195192
inherit socket
196193
method virtual send : Sockaddr.datagram -> Cstruct.t -> unit

lib_eio/net.mli

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,6 @@ val accept_fork :
211211
If you don't want to handle connection errors,
212212
use [~on_error:raise] to cancel the caller's context. *)
213213

214-
val accept_sub :
215-
sw:Switch.t ->
216-
#listening_socket ->
217-
on_error:(exn -> unit) ->
218-
(sw:Switch.t -> stream_socket -> Sockaddr.stream -> unit) ->
219-
unit
220-
[@@deprecated "Use accept_fork instead"]
221-
222214
(** {2 Running Servers} *)
223215

224216
val run_server :

0 commit comments

Comments
 (0)