Giter Club home page Giter Club logo

Comments (12)

kelunik avatar kelunik commented on June 4, 2024

Same applies to fopen, yes.

from sync.

enumag avatar enumag commented on June 4, 2024

Is it okay to add require amphp/file to composer.json?

from sync.

enumag avatar enumag commented on June 4, 2024

I don't want it to use async API magically when available. Seems weird.

from sync.

enumag avatar enumag commented on June 4, 2024

Imo we should either require amphp/file or throw exception if it isn't installed.

from sync.

kelunik avatar kelunik commented on June 4, 2024

Throwing would be a BC break. amphp/file depends on amphp/parallel, I'd rather avoid that dependency in amphp/sync, as amphp/cache depends on amphp/sync and amphp/dns depends on amphp/cache, where we removed amphp/file as a dependency some time ago on purpose.

from sync.

enumag avatar enumag commented on June 4, 2024

Then maybe we should add a separate class that would use the amphp/file or throw?

from sync.

enumag avatar enumag commented on June 4, 2024

AsyncFileMutex or something?

from sync.

enumag avatar enumag commented on June 4, 2024

and rename FileMutex to BlockingFileMutex with alias for BC I'd say...

from sync.

kelunik avatar kelunik commented on June 4, 2024

We can add AsyncFileMutex to amphp/file, not sure whether we need the rename.

from sync.

enumag avatar enumag commented on June 4, 2024

If it's in amphp/file then it becomes kinda hidden and ppl won't notice it. Renaming is necessary in my opinion to make it obvious that this class shouldn't actually be used.

from sync.

kelunik avatar kelunik commented on June 4, 2024

amphp/file is the right place for it, because it already depends on amphp/sync through amphp/parallel. If we release a new major version of amphp/file and have just a check here, things might break or get really hacky if we need to adapt.

Discoverability is can probably be solved via documentation.

from sync.

enumag avatar enumag commented on June 4, 2024

Alright, I'll try to implement it and open a PR at amphp/file. Thanks!

from sync.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.