Skip to content

Deprecated functions; will be removed#107

Closed
whitequark wants to merge 1 commit intoocsigen:masterfrom
whitequark:remove-deprecated
Closed

Deprecated functions; will be removed#107
whitequark wants to merge 1 commit intoocsigen:masterfrom
whitequark:remove-deprecated

Conversation

@whitequark
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note the (**/**) above--this function was not present in the documentation for quite a long time.

@vouillon
Copy link
Copy Markdown
Member

In the opam repository, the following packages use Lwt_unix.run: aws, cohttp, cowabloga, git, imaplet-lwt, irmin, js_of_ocaml, mirage-xen, obigstore, obus, ocsigenserver, ojs-base, sqlexpr, stog.
Lwt_io.of_string is used by obigstore.
Lwt_sys.window is used by lambda-term.
Also, the Lwt_util module, already removed, is used by redis, ocsigenserver and obigstore.

@vouillon
Copy link
Copy Markdown
Member

Given these statistics, maybe we should wait before removing Lwt_unix.run.

We should tell the authors of obigstore, lambda-term and redis about these removal.

@whitequark
Copy link
Copy Markdown
Contributor Author

@samoht
Copy link
Copy Markdown

samoht commented Dec 19, 2014

I learned that Lwt_main.run existed few days ago :p but yes, I am switching to use it in my projects now.

@zoggy
Copy link
Copy Markdown
Contributor

zoggy commented Feb 10, 2015

What should be used instead of Lwt_unix.run, then ?

@avsm
Copy link
Copy Markdown
Collaborator

avsm commented Feb 10, 2015

Lwt_main.run

On 10 Feb 2015, at 09:24, Zoggy notifications@github.com wrote:

What should be used instead of Lwt_unix.run, then ?


Reply to this email directly or view it on GitHub #107 (comment).

@whitequark
Copy link
Copy Markdown
Contributor Author

Will this be merged?

@aantron
Copy link
Copy Markdown
Collaborator

aantron commented Apr 29, 2016

Marked these deprecated more clearly. Can't use [@@ocaml.deprecated] because
Lwt still supports 4.01. Also marked Lwt_stream.on_terminate and Lwt_unix.execute_job. Lwt_io.of_string was removed in 6049279.

At least the following packages are still using Lwt_unix.run (some in tests
and examples, but nonetheless):

bistro, cowabloga, csvprovider, dog, git, git-unix, http2https,
imaplet-lwt, iocaml, irmin, irmin-unix, mbr-format,
merge-queues, merge-ropes, message-switch, mirage-git, mirage-irmin,
mirage-profile, mirage-unix, ppx_json_types, riak, sqlexpr, tuntap,
typerex-lldb

Eliom recommends Lwt_unix.run in its documentation
(doc/manual-wiki/server-services.wiki).

At least the following packages are using Lwt_stream.on_terminate:

cohttp

At least the following packages are using Lwt_unix.execute_job:

baardskeerder, lambda-term

No public package is apparently using Lwt_unix.has_wait4 or Lwt_sys.windows,
but there may be private code.

attn @pveber @avsm @rgrinberg @samoht @nv-vn @vasilisp @gregtatcam @andrewray
@talex5 @djs55 @mfp @lefessan

@aantron
Copy link
Copy Markdown
Collaborator

aantron commented Apr 29, 2016

attn @toolslive @metadave

@rgrinberg
Copy link
Copy Markdown
Contributor

rgrinberg commented Apr 29, 2016

@aantron What should we use instead of Lwt_stream.on_terminate

on_termination of course. I should remember that change.

@aantron
Copy link
Copy Markdown
Collaborator

aantron commented Apr 29, 2016

Lwt_stream.on_termination :)

@aantron aantron changed the title Remove deprecated Lwt_io.of_string, Lwt_sys.windows, Lwt_unix.{run,has_wait4}. Deprecated functions; will be removed Apr 29, 2016
@bookshelfdave
Copy link
Copy Markdown
Contributor

@aantron I appreciate the ping! I've only used this in the Riak client, which I haven't touched in years.

@nv-vn
Copy link
Copy Markdown

nv-vn commented Apr 30, 2016

Thanks for pinging, I've gone ahead and patched that in all projects that were using them.

@toolslive
Copy link
Copy Markdown

concerning Lwt_unix.execute_job. I don't see this pull request removing it.
Am I missing something ?

As an aside, I recently worked on the ordma package and needed to implement a new Lwt engine, based on librdmacm's rselect. There were some problems:

  • Lwt checks for readability (Lwt_unix.readable) on a Lwt.file_descr on the side using a separate call to poll here, iso going through the engine. This breaks down if the resource represented by this Lwt.file_descr is not a resource that can be poll-ed (in this case an rsocket).
  • Lwt.file.descr has some internal state (the state attribute )that cannot be manipulated through the interface. This forced me into using a private copy the definition, and a "cast" via Obj.magic,
    which is really ugly. A typical example is the close call.

Basically, what I'm saying is that there is an API to plug in your own lwt engine, but that it doesn't really work when you actually try to do this (or I wasn't smart enough to figure out how to do this cleanly).

@aantron
Copy link
Copy Markdown
Collaborator

aantron commented Apr 30, 2016

@toolslive This PR didn't originally seek to remove execute_job, but it does now. A commit to do this hasn't been posted yet, because it's too early at this point.

As an aside, ...

Would you be willing to turn this into a separate issue? Copy/paste from here is fine, but reproduction cases and/or patches are also very welcome :)

talex5 added a commit to talex5/mirage-profile that referenced this pull request Apr 30, 2016
talex5 added a commit to talex5/mirage-platform that referenced this pull request Apr 30, 2016
talex5 pushed a commit to talex5/irmin that referenced this pull request Apr 30, 2016
talex5 added a commit to talex5/ocaml-git that referenced this pull request Apr 30, 2016
@toolslive
Copy link
Copy Markdown

toolslive commented Apr 30, 2016

the aside is continued here

What's the alternative for Lwt_unix.execute_job ?

@aantron
Copy link
Copy Markdown
Collaborator

aantron commented Apr 30, 2016

Thanks. Lwt_unix.run_job is the alternative.

avsm pushed a commit to avsm/ocaml-git that referenced this pull request Nov 24, 2016
@aantron aantron closed this in 5737f5b Nov 29, 2016
@aantron
Copy link
Copy Markdown
Collaborator

aantron commented Nov 29, 2016

Now using deprecation warnings ([@ocaml.deprecated]). See also #293 ("Semantic versioning; safely breaking Lwt").

hannesm pushed a commit to mirage/mirage-unix that referenced this pull request Mar 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants