Comments (12)
Same applies to fopen
, yes.
from sync.
Is it okay to add require amphp/file to composer.json?
from sync.
I don't want it to use async API magically when available. Seems weird.
from sync.
Imo we should either require amphp/file or throw exception if it isn't installed.
from sync.
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.
Then maybe we should add a separate class that would use the amphp/file or throw?
from sync.
AsyncFileMutex or something?
from sync.
and rename FileMutex to BlockingFileMutex with alias for BC I'd say...
from sync.
We can add AsyncFileMutex
to amphp/file
, not sure whether we need the rename.
from sync.
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.
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.
Alright, I'll try to implement it and open a PR at amphp/file. Thanks!
from sync.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sync.