uvi-script
Musical event scripting with Lua
Loading...
Searching...
No Matches
AsyncDataLoadTask Class Reference

An Asyncronous task that reads a file from disk. More...

Inheritance diagram for AsyncDataLoadTask:
AsyncTask

Public Attributes

string data
 the raw file contents, as a string (nil if the file could not be read).
 
- Public Attributes inherited from AsyncTask
int id
 unique identifier for this task
 
bool finished
 a flag to indicate whether the task has been completed.
 
float progress
 a value between 0 and 1 to be notified of the task's progress.
 
bool success
 a flag to indicate whether the task has been successful.
 
string state
 a string to indicate the current task state (pending | running | finished | cancelled)
 

Additional Inherited Members

- Public Member Functions inherited from AsyncTask
void cancel ()
 notify the task that it should be cancelled.
 

Detailed Description

An Asyncronous task that reads a file from disk.

Tasks returned by loadData() and loadTextData().

Member Data Documentation

◆ data

string AsyncDataLoadTask::data

the raw file contents, as a string (nil if the file could not be read).

The callbacks passed to loadData and loadTextData receive the data already decoded, so they never touch this property. It is what makes the polling pattern usable: wait until task.finished, then read task.data and decode it yourself — see Custom Data I/O.