IOSchedule
- class IOSchedule
An IO schedule that can be executed concurrently on an
Executor.Members defined in
IOSchedule(9 members)
RWIf true, new text documents will be constructed for multithreaded application, otherwise - single threaded. Only has effect if no
TextDocumentsis set.
RReturns the number of currently scheduled documents
RWTextDocumentsthat new text files will be opened in
Schedule a new file to read at
path
Schedule a new in-memory source at
url
Set
TextDocumentsthat new text files will be opened in
Create a new schedule
Set completion callback that will be invoked when a text document is ready.
Builder pattern setter for
is_multithreaded. Attributes
- property is_multithreaded: bool
If true, new text documents will be constructed for multithreaded application, otherwise - single threaded. Only has effect if no
TextDocumentsis set.
- property size: int
Returns the number of currently scheduled documents
- property text_documents: syside.TextDocuments | None
TextDocumentsthat new text files will be opened in
Methods
- add_file(path: str | os.PathLike[AnyStr], language: str, tier: syside.DocumentTier = DocumentTier.Project) syside.IOSchedule
Schedule a new file to read at
path
- add_source(url: syside.Url, contents: str, language: str, tier: syside.DocumentTier = DocumentTier.Project) syside.IOSchedule
Schedule a new in-memory source at
url
- assign_text_documents(arg: syside.TextDocuments, /) syside.IOSchedule
Set
TextDocumentsthat new text files will be opened in
- static make_empty_schedule(multithreaded: bool = False) syside.IOSchedule
Create a new schedule
- set_completion_callback(arg: Callable[[syside.SharedMutex[syside.TextDocument], syside.IOSchedule], None], /) syside.IOSchedule
Set completion callback that will be invoked when a text document is ready.
The second callback argument contains the index of the document, and order between add_* is preserved. Note that this may be called from multiple other threads so this should be thread-safe, e.g. by sizing a result buffer to size() before executing this schedule and only modifying the element at the callback index.
On a single-thread executor, only the first enqueued unique source will invoke this callback. On multithreaded executors, any one of duplicated sources may invoke this callback, however it is unspecified which. Deduplication is performed based on resolved absolute URLs.
- set_multithreaded(arg: bool, /) syside.IOSchedule
Builder pattern setter for
is_multithreaded.