| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
SDL3.Sys.Bindgen.Asyncio
Description
SDL offers a way to perform I/O asynchronously. This allows an app to read or write files without waiting for data to actually transfer; the functions that request I/O never block while the request is fulfilled.
Instead, the data moves in the background and the app can check for results at their leisure.
This is more complicated than just reading and writing files in a synchronous way, but it can allow for more efficiency, and never having framerate drops as the hard drive catches up, etc.
The general usage pattern for async I/O is:
- Create one or more
SDL_AsyncIOQueueobjects. - Open files with SDL_AsyncIOFromFile.
- Start I/O tasks to the files with SDL_ReadAsyncIO or SDL_WriteAsyncIO, putting those tasks into one of the queues.
- Later on, use SDL_GetAsyncIOResult on a queue to see if any task is finished without blocking. Tasks might finish in any order with success or failure.
- When all your tasks are done, close the file with SDL_CloseAsyncIO. This also generates a task, since it might flush data to disk!
This all works, without blocking, in a single thread, but one can also wait on a queue in a background thread, sleeping until new results have arrived:
- Call SDL_WaitAsyncIOResult from one or more threads to efficiently block until new tasks complete.
- When shutting down, call SDL_SignalAsyncIOQueue to unblock any sleeping threads despite there being no new tasks completed.
And, of course, to match the synchronous SDL_LoadFile, we offer SDL_LoadFileAsync as a convenience function. This will handle allocating a buffer, slurping in the file data, and null-terminating it; you still check for results later.
Behind the scenes, SDL will use newer, efficient APIs on platforms that support them: Linux's io_uring and Windows 11's IoRing, for example. If those technologies aren't available, SDL will offload the work to a thread pool that will manage otherwise-synchronous loads without blocking the app.
Best Practices
Simple non-blocking I/O for an app that just wants to pick up data whenever it's ready without losing framerate waiting on disks to spin can use whatever pattern works well for the program. In this case, simply call SDL_ReadAsyncIO, or maybe SDL_LoadFileAsync, as needed. Once a frame, call SDL_GetAsyncIOResult to check for any completed tasks and deal with the data as it arrives.
If two separate pieces of the same program need their own I/O, it is legal for each to create their own queue. This will prevent either piece from accidentally consuming the other's completed tasks. Each queue does require some amount of resources, but it is not an overwhelming cost. Do not make a queue for each task, however. It is better to put many tasks into a single queue. They will be reported in order of completion, not in the order they were submitted, so it doesn't generally matter what order tasks are started.
One async I/O queue can be shared by multiple threads, or one thread can have more than one queue, but the most efficient way if ruthless efficiency is the goal is to have one queue per thread, with multiple threads working in parallel, and attempt to keep each queue loaded with tasks that are both started by and consumed by the same thread. On modern platforms that can use newer interfaces, this can keep data flowing as efficiently as possible all the way from storage hardware to the app, with no contention between threads for access to the same queue.
Written data is not guaranteed to make it to physical media by the time a closing task is completed, unless SDL_CloseAsyncIO is called with its flush parameter set to true, which is to say that a successful result here can still result in lost data during an unfortunately-timed power outage if not flushed. However, flushing will take longer and may be unnecessary, depending on the app's needs. The asynchronous I/O operation structure.
This operates as an opaque handle. One can then request read or write operations on it.
- See also
sDL_AsyncIOFromFile
Since: 3.2.0
Synopsis
- data SDL_AsyncIO
- newtype SDL_AsyncIOTaskType = SDL_AsyncIOTaskType {}
- pattern SDL_ASYNCIO_TASK_READ :: SDL_AsyncIOTaskType
- pattern SDL_ASYNCIO_TASK_WRITE :: SDL_AsyncIOTaskType
- pattern SDL_ASYNCIO_TASK_CLOSE :: SDL_AsyncIOTaskType
- newtype SDL_AsyncIOResult = SDL_AsyncIOResult {}
- pattern SDL_ASYNCIO_COMPLETE :: SDL_AsyncIOResult
- pattern SDL_ASYNCIO_FAILURE :: SDL_AsyncIOResult
- pattern SDL_ASYNCIO_CANCELED :: SDL_AsyncIOResult
- data SDL_AsyncIOOutcome = SDL_AsyncIOOutcome {}
- data SDL_AsyncIOQueue
Documentation
data SDL_AsyncIO Source #
- C declaration
struct SDL_AsyncIO, defined atSDL3/SDL_asyncio.h 124:16
newtype SDL_AsyncIOTaskType Source #
Types of asynchronous I/O tasks.
- C declaration
enum SDL_AsyncIOTaskType, defined atSDL3/SDL_asyncio.h 131:14
Since: 3.2.0
Constructors
| SDL_AsyncIOTaskType | |
Instances
pattern SDL_ASYNCIO_TASK_READ :: SDL_AsyncIOTaskType Source #
A read operation.
- C declaration
SDL_ASYNCIO_TASK_READ, defined atSDL3/SDL_asyncio.h 133:5
pattern SDL_ASYNCIO_TASK_WRITE :: SDL_AsyncIOTaskType Source #
A write operation.
- C declaration
SDL_ASYNCIO_TASK_WRITE, defined atSDL3/SDL_asyncio.h 134:5
pattern SDL_ASYNCIO_TASK_CLOSE :: SDL_AsyncIOTaskType Source #
A close operation.
- C declaration
SDL_ASYNCIO_TASK_CLOSE, defined atSDL3/SDL_asyncio.h 135:5
newtype SDL_AsyncIOResult Source #
Possible outcomes of an asynchronous I/O task.
- C declaration
enum SDL_AsyncIOResult, defined atSDL3/SDL_asyncio.h 143:14
Since: 3.2.0
Constructors
| SDL_AsyncIOResult | |
Instances
| Storable SDL_AsyncIOResult Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods sizeOf :: SDL_AsyncIOResult -> Int # alignment :: SDL_AsyncIOResult -> Int # peekElemOff :: Ptr SDL_AsyncIOResult -> Int -> IO SDL_AsyncIOResult # pokeElemOff :: Ptr SDL_AsyncIOResult -> Int -> SDL_AsyncIOResult -> IO () # peekByteOff :: Ptr b -> Int -> IO SDL_AsyncIOResult # pokeByteOff :: Ptr b -> Int -> SDL_AsyncIOResult -> IO () # peek :: Ptr SDL_AsyncIOResult -> IO SDL_AsyncIOResult # poke :: Ptr SDL_AsyncIOResult -> SDL_AsyncIOResult -> IO () # | |||||
| Generic SDL_AsyncIOResult Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Associated Types
Methods from :: SDL_AsyncIOResult -> Rep SDL_AsyncIOResult x # to :: Rep SDL_AsyncIOResult x -> SDL_AsyncIOResult # | |||||
| Read SDL_AsyncIOResult Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods readsPrec :: Int -> ReadS SDL_AsyncIOResult # readList :: ReadS [SDL_AsyncIOResult] # | |||||
| Show SDL_AsyncIOResult Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods showsPrec :: Int -> SDL_AsyncIOResult -> ShowS # show :: SDL_AsyncIOResult -> String # showList :: [SDL_AsyncIOResult] -> ShowS # | |||||
| Eq SDL_AsyncIOResult Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods (==) :: SDL_AsyncIOResult -> SDL_AsyncIOResult -> Bool # (/=) :: SDL_AsyncIOResult -> SDL_AsyncIOResult -> Bool # | |||||
| Ord SDL_AsyncIOResult Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods compare :: SDL_AsyncIOResult -> SDL_AsyncIOResult -> Ordering # (<) :: SDL_AsyncIOResult -> SDL_AsyncIOResult -> Bool # (<=) :: SDL_AsyncIOResult -> SDL_AsyncIOResult -> Bool # (>) :: SDL_AsyncIOResult -> SDL_AsyncIOResult -> Bool # (>=) :: SDL_AsyncIOResult -> SDL_AsyncIOResult -> Bool # max :: SDL_AsyncIOResult -> SDL_AsyncIOResult -> SDL_AsyncIOResult # min :: SDL_AsyncIOResult -> SDL_AsyncIOResult -> SDL_AsyncIOResult # | |||||
| Prim SDL_AsyncIOResult Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods sizeOfType# :: Proxy SDL_AsyncIOResult -> Int# # sizeOf# :: SDL_AsyncIOResult -> Int# # alignmentOfType# :: Proxy SDL_AsyncIOResult -> Int# # alignment# :: SDL_AsyncIOResult -> Int# # indexByteArray# :: ByteArray# -> Int# -> SDL_AsyncIOResult # readByteArray# :: MutableByteArray# s -> Int# -> State# s -> (# State# s, SDL_AsyncIOResult #) # writeByteArray# :: MutableByteArray# s -> Int# -> SDL_AsyncIOResult -> State# s -> State# s # setByteArray# :: MutableByteArray# s -> Int# -> Int# -> SDL_AsyncIOResult -> State# s -> State# s # indexOffAddr# :: Addr# -> Int# -> SDL_AsyncIOResult # readOffAddr# :: Addr# -> Int# -> State# s -> (# State# s, SDL_AsyncIOResult #) # writeOffAddr# :: Addr# -> Int# -> SDL_AsyncIOResult -> State# s -> State# s # setOffAddr# :: Addr# -> Int# -> Int# -> SDL_AsyncIOResult -> State# s -> State# s # | |||||
| CEnum SDL_AsyncIOResult Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Associated Types
Methods toCEnum :: CEnumZ SDL_AsyncIOResult -> SDL_AsyncIOResult # fromCEnum :: SDL_AsyncIOResult -> CEnumZ SDL_AsyncIOResult # declaredValues :: proxy SDL_AsyncIOResult -> DeclaredValues SDL_AsyncIOResult # showsUndeclared :: proxy SDL_AsyncIOResult -> Int -> CEnumZ SDL_AsyncIOResult -> ShowS # readPrecUndeclared :: ReadPrec SDL_AsyncIOResult # isDeclared :: SDL_AsyncIOResult -> Bool # mkDeclared :: CEnumZ SDL_AsyncIOResult -> Maybe SDL_AsyncIOResult # | |||||
| SequentialCEnum SDL_AsyncIOResult Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio | |||||
| HasFFIType SDL_AsyncIOResult Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Associated Types
Methods toFFIType :: SDL_AsyncIOResult -> FFIType SDL_AsyncIOResult # fromFFIType :: FFIType SDL_AsyncIOResult -> SDL_AsyncIOResult # | |||||
| ReadRaw SDL_AsyncIOResult Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods | |||||
| StaticSize SDL_AsyncIOResult Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods staticSizeOf :: Proxy SDL_AsyncIOResult -> Int # | |||||
| WriteRaw SDL_AsyncIOResult Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods writeRaw :: Ptr SDL_AsyncIOResult -> SDL_AsyncIOResult -> IO () # | |||||
| HasCField SDL_AsyncIOResult "unwrap" Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Associated Types
| |||||
| ty ~ CUInt => HasField "unwrap" SDL_AsyncIOResult ty Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods hasField :: SDL_AsyncIOResult -> (ty -> SDL_AsyncIOResult, ty) # | |||||
| ty ~ CUInt => HasField "unwrap" (Ptr SDL_AsyncIOResult) (Ptr ty :: Type) Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods getField :: Ptr SDL_AsyncIOResult -> Ptr ty # | |||||
| type Rep SDL_AsyncIOResult Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio type Rep SDL_AsyncIOResult = D1 ('MetaData "SDL_AsyncIOResult" "SDL3.Sys.Bindgen.Asyncio" "sdl3-bindgen-sys-0.0.1.0-inplace" 'True) (C1 ('MetaCons "SDL_AsyncIOResult" 'PrefixI 'True) (S1 ('MetaSel ('Just "unwrap") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CUInt))) | |||||
| type CEnumZ SDL_AsyncIOResult Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio | |||||
| type FFIType SDL_AsyncIOResult Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio | |||||
| type CFieldType SDL_AsyncIOResult "unwrap" Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio | |||||
pattern SDL_ASYNCIO_COMPLETE :: SDL_AsyncIOResult Source #
request was completed without error
- C declaration
SDL_ASYNCIO_COMPLETE, defined atSDL3/SDL_asyncio.h 145:5
pattern SDL_ASYNCIO_FAILURE :: SDL_AsyncIOResult Source #
request failed for some reason; check SDL_GetError()!
- C declaration
SDL_ASYNCIO_FAILURE, defined atSDL3/SDL_asyncio.h 146:5
pattern SDL_ASYNCIO_CANCELED :: SDL_AsyncIOResult Source #
request was canceled before completing.
- C declaration
SDL_ASYNCIO_CANCELED, defined atSDL3/SDL_asyncio.h 147:5
data SDL_AsyncIOOutcome Source #
Information about a completed asynchronous I/O request.
- C declaration
struct SDL_AsyncIOOutcome, defined atSDL3/SDL_asyncio.h 155:16
Since: 3.2.0
Constructors
| SDL_AsyncIOOutcome | |
Fields
| |
Instances
| Storable SDL_AsyncIOOutcome Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods sizeOf :: SDL_AsyncIOOutcome -> Int # alignment :: SDL_AsyncIOOutcome -> Int # peekElemOff :: Ptr SDL_AsyncIOOutcome -> Int -> IO SDL_AsyncIOOutcome # pokeElemOff :: Ptr SDL_AsyncIOOutcome -> Int -> SDL_AsyncIOOutcome -> IO () # peekByteOff :: Ptr b -> Int -> IO SDL_AsyncIOOutcome # pokeByteOff :: Ptr b -> Int -> SDL_AsyncIOOutcome -> IO () # peek :: Ptr SDL_AsyncIOOutcome -> IO SDL_AsyncIOOutcome # poke :: Ptr SDL_AsyncIOOutcome -> SDL_AsyncIOOutcome -> IO () # | |||||
| Generic SDL_AsyncIOOutcome Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Associated Types
Methods from :: SDL_AsyncIOOutcome -> Rep SDL_AsyncIOOutcome x # to :: Rep SDL_AsyncIOOutcome x -> SDL_AsyncIOOutcome # | |||||
| Show SDL_AsyncIOOutcome Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods showsPrec :: Int -> SDL_AsyncIOOutcome -> ShowS # show :: SDL_AsyncIOOutcome -> String # showList :: [SDL_AsyncIOOutcome] -> ShowS # | |||||
| Eq SDL_AsyncIOOutcome Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods (==) :: SDL_AsyncIOOutcome -> SDL_AsyncIOOutcome -> Bool # (/=) :: SDL_AsyncIOOutcome -> SDL_AsyncIOOutcome -> Bool # | |||||
| ReadRaw SDL_AsyncIOOutcome Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods readRaw :: Ptr SDL_AsyncIOOutcome -> IO SDL_AsyncIOOutcome # | |||||
| StaticSize SDL_AsyncIOOutcome Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods staticSizeOf :: Proxy SDL_AsyncIOOutcome -> Int # | |||||
| WriteRaw SDL_AsyncIOOutcome Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods writeRaw :: Ptr SDL_AsyncIOOutcome -> SDL_AsyncIOOutcome -> IO () # | |||||
| IsStruct SDL_AsyncIOOutcome Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods | |||||
| HasCField SDL_AsyncIOOutcome "asyncio" Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Associated Types
| |||||
| HasCField SDL_AsyncIOOutcome "buffer" Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Associated Types
| |||||
| HasCField SDL_AsyncIOOutcome "bytes_requested" Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Associated Types
| |||||
| HasCField SDL_AsyncIOOutcome "bytes_transferred" Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Associated Types
| |||||
| HasCField SDL_AsyncIOOutcome "offset" Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Associated Types
| |||||
| HasCField SDL_AsyncIOOutcome "result" Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Associated Types
| |||||
| HasCField SDL_AsyncIOOutcome "type'" Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Associated Types
| |||||
| HasCField SDL_AsyncIOOutcome "userdata" Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Associated Types
| |||||
| ty ~ Ptr SDL_AsyncIO => HasField "asyncio" SDL_AsyncIOOutcome ty Source # | what generated this task. This pointer will be invalid if it was closed!
| ||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods hasField :: SDL_AsyncIOOutcome -> (ty -> SDL_AsyncIOOutcome, ty) # | |||||
| ty ~ Ptr Void => HasField "buffer" SDL_AsyncIOOutcome ty Source # | buffer where data was read/written.
| ||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods hasField :: SDL_AsyncIOOutcome -> (ty -> SDL_AsyncIOOutcome, ty) # | |||||
| ty ~ Uint64 => HasField "bytes_requested" SDL_AsyncIOOutcome ty Source # | number of bytes the task was to read/write.
| ||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods hasField :: SDL_AsyncIOOutcome -> (ty -> SDL_AsyncIOOutcome, ty) # | |||||
| ty ~ Uint64 => HasField "bytes_transferred" SDL_AsyncIOOutcome ty Source # | actual number of bytes that were read/written.
| ||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods hasField :: SDL_AsyncIOOutcome -> (ty -> SDL_AsyncIOOutcome, ty) # | |||||
| ty ~ Uint64 => HasField "offset" SDL_AsyncIOOutcome ty Source # | offset in the
| ||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods hasField :: SDL_AsyncIOOutcome -> (ty -> SDL_AsyncIOOutcome, ty) # | |||||
| ty ~ SDL_AsyncIOResult => HasField "result" SDL_AsyncIOOutcome ty Source # | the result of the work (success, failure, cancellation).
| ||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods hasField :: SDL_AsyncIOOutcome -> (ty -> SDL_AsyncIOOutcome, ty) # | |||||
| ty ~ SDL_AsyncIOTaskType => HasField "type'" SDL_AsyncIOOutcome ty Source # | What sort of task was this? Read, write, etc?
| ||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods hasField :: SDL_AsyncIOOutcome -> (ty -> SDL_AsyncIOOutcome, ty) # | |||||
| ty ~ Ptr Void => HasField "userdata" SDL_AsyncIOOutcome ty Source # | pointer provided by the app when starting the task
| ||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods hasField :: SDL_AsyncIOOutcome -> (ty -> SDL_AsyncIOOutcome, ty) # | |||||
| ty ~ Ptr SDL_AsyncIO => HasField "asyncio" (Ptr SDL_AsyncIOOutcome) (Ptr ty :: Type) Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods getField :: Ptr SDL_AsyncIOOutcome -> Ptr ty # | |||||
| ty ~ Ptr Void => HasField "buffer" (Ptr SDL_AsyncIOOutcome) (Ptr ty :: Type) Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods getField :: Ptr SDL_AsyncIOOutcome -> Ptr ty # | |||||
| ty ~ Uint64 => HasField "bytes_requested" (Ptr SDL_AsyncIOOutcome) (Ptr ty :: Type) Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods getField :: Ptr SDL_AsyncIOOutcome -> Ptr ty # | |||||
| ty ~ Uint64 => HasField "bytes_transferred" (Ptr SDL_AsyncIOOutcome) (Ptr ty :: Type) Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods getField :: Ptr SDL_AsyncIOOutcome -> Ptr ty # | |||||
| ty ~ Uint64 => HasField "offset" (Ptr SDL_AsyncIOOutcome) (Ptr ty :: Type) Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods getField :: Ptr SDL_AsyncIOOutcome -> Ptr ty # | |||||
| ty ~ SDL_AsyncIOResult => HasField "result" (Ptr SDL_AsyncIOOutcome) (Ptr ty :: Type) Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods getField :: Ptr SDL_AsyncIOOutcome -> Ptr ty # | |||||
| ty ~ SDL_AsyncIOTaskType => HasField "type'" (Ptr SDL_AsyncIOOutcome) (Ptr ty :: Type) Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods getField :: Ptr SDL_AsyncIOOutcome -> Ptr ty # | |||||
| ty ~ Ptr Void => HasField "userdata" (Ptr SDL_AsyncIOOutcome) (Ptr ty :: Type) Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio Methods getField :: Ptr SDL_AsyncIOOutcome -> Ptr ty # | |||||
| type Rep SDL_AsyncIOOutcome Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio type Rep SDL_AsyncIOOutcome = D1 ('MetaData "SDL_AsyncIOOutcome" "SDL3.Sys.Bindgen.Asyncio" "sdl3-bindgen-sys-0.0.1.0-inplace" 'False) (C1 ('MetaCons "SDL_AsyncIOOutcome" 'PrefixI 'True) (((S1 ('MetaSel ('Just "asyncio") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Ptr SDL_AsyncIO)) :*: S1 ('MetaSel ('Just "type'") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SDL_AsyncIOTaskType)) :*: (S1 ('MetaSel ('Just "result") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SDL_AsyncIOResult) :*: S1 ('MetaSel ('Just "buffer") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Ptr Void)))) :*: ((S1 ('MetaSel ('Just "offset") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Uint64) :*: S1 ('MetaSel ('Just "bytes_requested") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Uint64)) :*: (S1 ('MetaSel ('Just "bytes_transferred") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Uint64) :*: S1 ('MetaSel ('Just "userdata") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Ptr Void)))))) | |||||
| type CFieldType SDL_AsyncIOOutcome "asyncio" Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio | |||||
| type CFieldType SDL_AsyncIOOutcome "buffer" Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio | |||||
| type CFieldType SDL_AsyncIOOutcome "bytes_requested" Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio | |||||
| type CFieldType SDL_AsyncIOOutcome "bytes_transferred" Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio | |||||
| type CFieldType SDL_AsyncIOOutcome "offset" Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio | |||||
| type CFieldType SDL_AsyncIOOutcome "result" Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio | |||||
| type CFieldType SDL_AsyncIOOutcome "type'" Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio | |||||
| type CFieldType SDL_AsyncIOOutcome "userdata" Source # | |||||
Defined in SDL3.Sys.Bindgen.Asyncio | |||||
data SDL_AsyncIOQueue Source #
A queue of completed asynchronous I/O tasks.
When starting an asynchronous operation, you specify a queue for the new task. A queue can be asked later if any tasks in it have completed, allowing an app to manage multiple pending tasks in one place, in whatever order they complete.
- See also
sDL_CreateAsyncIOQueue,sDL_ReadAsyncIO,sDL_WriteAsyncIO,sDL_GetAsyncIOResult,sDL_WaitAsyncIOResult- C declaration
struct SDL_AsyncIOQueue, defined atSDL3/SDL_asyncio.h 183:16
Since: 3.2.0