Hoogle Search
Within LTS Haskell 24.68 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
gi-gio GI.Gio.Objects.InputStream Tries to read count bytes from the stream into the buffer starting at buffer. Will block during this read. If count is zero returns zero and does nothing. A value of count larger than G_MAXSSIZE will cause a IOErrorEnumInvalidArgument error. On success, the number of bytes read into the buffer is returned. It is not an error if this is not the same as the requested size, as it can happen e.g. near the end of a file. Zero is returned on end of file (or if count is zero), but never otherwise. The returned buffer is not a nul-terminated string, it can contain nul bytes at any position, and this function doesn't nul-terminate the buffer. If cancellable is not Nothing, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error IOErrorEnumCancelled will be returned. If an operation was partially finished when the operation was cancelled the partial result will be returned, without an error. On error -1 is returned and error is set accordingly.
-
gi-gio GI.Gio.Objects.InputStream Tries to read count bytes from the stream into the buffer starting at buffer. Will block during this read. This function is similar to inputStreamRead, except it tries to read as many bytes as requested, only stopping on an error or end of stream. On a successful read of count bytes, or if we reached the end of the stream, True is returned, and bytesRead is set to the number of bytes read into buffer. If there is an error during the operation False is returned and error is set to indicate the error status. As a special exception to the normal conventions for functions that use GError, if this function returns False (and sets error) then bytesRead will be set to the number of bytes that were successfully read before the error was encountered. This functionality is only available from C. If you need it from another language then you must write your own loop around inputStreamRead.
-
gi-gio GI.Gio.Objects.InputStream Request an asynchronous read of count bytes from the stream into the buffer starting at buffer. This is the asynchronous equivalent of inputStreamReadAll. Call inputStreamReadAllFinish to collect the result. Any outstanding I/O request with higher priority (lower numerical value) will be executed before an outstanding request with lower priority. Default priority is PRIORITY_DEFAULT. Since: 2.44
-
gi-gio GI.Gio.Objects.InputStream Finishes an asynchronous stream read operation started with inputStreamReadAllAsync. As a special exception to the normal conventions for functions that use GError, if this function returns False (and sets error) then bytesRead will be set to the number of bytes that were successfully read before the error was encountered. This functionality is only available from C. If you need it from another language then you must write your own loop around inputStreamReadAsync. Since: 2.44
-
gi-gio GI.Gio.Objects.InputStream Request an asynchronous read of count bytes from the stream into the buffer starting at buffer. When the operation is finished callback will be called. You can then call inputStreamReadFinish to get the result of the operation. During an async request no other sync and async calls are allowed on stream, and will result in IOErrorEnumPending errors. A value of count larger than G_MAXSSIZE will cause a IOErrorEnumInvalidArgument error. On success, the number of bytes read into the buffer will be passed to the callback. It is not an error if this is not the same as the requested size, as it can happen e.g. near the end of a file, but generally we try to read as many bytes as requested. Zero is returned on end of file (or if count is zero), but never otherwise. Any outstanding i/o request with higher priority (lower numerical value) will be executed before an outstanding request with lower priority. Default priority is PRIORITY_DEFAULT. The asynchronous methods have a default fallback that uses threads to implement asynchronicity, so they are optional for inheriting classes. However, if you override one you must override all.
-
gi-gio GI.Gio.Objects.InputStream Like inputStreamRead, this tries to read count bytes from the stream in a blocking fashion. However, rather than reading into a user-supplied buffer, this will create a new Bytes containing the data that was read. This may be easier to use from language bindings. If count is zero, returns a zero-length Bytes and does nothing. A value of count larger than G_MAXSSIZE will cause a IOErrorEnumInvalidArgument error. On success, a new Bytes is returned. It is not an error if the size of this object is not the same as the requested size, as it can happen e.g. near the end of a file. A zero-length Bytes is returned on end of file (or if count is zero), but never otherwise. If cancellable is not Nothing, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error IOErrorEnumCancelled will be returned. If an operation was partially finished when the operation was cancelled the partial result will be returned, without an error. On error Nothing is returned and error is set accordingly. Since: 2.34
-
gi-gio GI.Gio.Objects.InputStream Request an asynchronous read of count bytes from the stream into a new Bytes. When the operation is finished callback will be called. You can then call inputStreamReadBytesFinish to get the result of the operation. During an async request no other sync and async calls are allowed on stream, and will result in IOErrorEnumPending errors. A value of count larger than G_MAXSSIZE will cause a IOErrorEnumInvalidArgument error. On success, the new Bytes will be passed to the callback. It is not an error if this is smaller than the requested size, as it can happen e.g. near the end of a file, but generally we try to read as many bytes as requested. Zero is returned on end of file (or if count is zero), but never otherwise. Any outstanding I/O request with higher priority (lower numerical value) will be executed before an outstanding request with lower priority. Default priority is PRIORITY_DEFAULT. Since: 2.34
-
gi-gio GI.Gio.Objects.InputStream Finishes an asynchronous stream read-into-tBytes operation. Since: 2.34
-
gi-gio GI.Gio.Objects.InputStream Finishes an asynchronous stream read operation.
taskRunInThread :: (HasCallStack, MonadIO m, IsTask a) => a -> TaskThreadFunc -> m ()gi-gio GI.Gio.Objects.Task Runs taskFunc in another thread. When taskFunc returns, task's AsyncReadyCallback will be invoked in task's MainContext. This takes a ref on task until the task completes. See TaskThreadFunc for more details about how taskFunc is handled. Although GLib currently rate-limits the tasks queued via taskRunInThread, you should not assume that it will always do this. If you have a very large number of tasks to run (several tens of tasks), but don't want them to all run at once, you should only queue a limited number of them (around ten) at a time. Be aware that if your task depends on other tasks to complete, use of this function could lead to a livelock if the other tasks also use this function and enough of them (around 10) execute in a dependency chain, as that will exhaust the thread pool. If this situation is possible, consider using a separate worker thread or thread pool explicitly, rather than using taskRunInThread. Since: 2.36