IOSchedule

class IOSchedule

An IO schedule that can be executed concurrently on an Executor.

Members defined in IOSchedule (9 members)

is_multithreaded

RW

If true, new text documents will be constructed for multithreaded application, otherwise - single threaded. Only has effect if no TextDocuments is set.

size

R

Returns the number of currently scheduled documents

text_documents

RW

TextDocuments that new text files will be opened in

add_file

Schedule a new file to read at path

add_source

Schedule a new in-memory source at url

assign_text_documents

Set TextDocuments that new text files will be opened in

make_empty_schedule

Create a new schedule

set_completion_callback

Set completion callback that will be invoked when a text document is ready.

set_multithreaded

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 TextDocuments is set.

property size: int

Returns the number of currently scheduled documents

property text_documents: syside.TextDocuments | None

TextDocuments that 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 TextDocuments that 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.

Used in