Hi everybody,

 I am happy to announce that we now have a JavaScript module for Off
Main Thread File I/O (OMTF). This module is called OS.File and, if you
need to access files from your code, you really should use it. If you
own code that does main thread file I/O, you should really migrate it as
soon as possible.

This is true both for platform code and for add-ons.

Have fun!

*** Off Main Thread File I/O mini-FAQ

Q: Why do we need Off Main Thread File I/O?
A: Because the duration of *any* I/O operation is unbounded. Even
closing a file from the main thread can block your UI for several
seconds, unpredictably.


Q: Aren't NetUtils.asyncFetch and NetUtils.asyncCopy sufficient?
A1: Most uses of NetUtils.asyncCopy I have seen seem to actually perform
some main thread file I/O behind the scenes. OS.File is generally more
efficient and doesn't. Please use OS.File for file I/O.

A2: Also, OS.File provides plenty of other Off Main Thread operations,
including renaming, copying files, traversing directories, etc.

Q: Any documentation?
A: Glad you asked -
https://developer.mozilla.org/en-US/docs/JavaScript_OS.File (Work In
Progress)


Cheers,
 David

-- 
David Rajchenbach-Teller, PhD
 Performance Team, Mozilla

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to