Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file types.ml
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798(** Module for abstracting async and lwt *)moduletypeIo=sigmoduleDeferred:sigtype'atmoduleOr_error:sigtypenonrec'at=('a,exn)resulttvalreturn:'a->'atvalfail:exn->'atvalcatch:(unit->'at)->'atval(>>=):'at->('a->'bt)->'btendvalreturn:'a->'atvalafter:float->unittvalcatch:(unit->'at)->'aOr_error.tvalasync:unitt->unitval(>>=):'at->('a->'bt)->'btval(>>|):'at->('a->'b)->'btval(>>=?):('a,'c)resultt->('a->('b,'c)resultt)->('b,'c)resulttend(**/**)moduleIvar:sigtype'atvalcreate:unit->'atvalfill:'at->'a->unitvalwait:'at->'aDeferred.tend(**/**)(** Module mimicking Async.Pipe *)modulePipe:sig(** Generic pipe *)type('a,'b)pipe(**/**)typewriter_phantomtypereader_phantom(**/**)type'awriter=('a,writer_phantom)pipetype'areader=('a,reader_phantom)pipe(** Create a reader given a function f that fills the reader. Once f completes, the reader is closed *)valcreate_reader:f:('awriter->unitDeferred.t)->'areader(** Create a writer given a function f that reads off the writer. Once f completes, the writer is closed *)valcreate_writer:f:('areader->unitDeferred.t)->'awriter(** Create a reader/writer pipe. Data written to the reader can be read by the writer.
Closing one end will close both ends. *)valcreate:unit->'areader*'awriter(** Flush a writer. The result we be determined once all elements in the pipe has been consumed *)valflush:'awriter->unitDeferred.t(** Write to a writer. If the writer is closed, the function raises an exception *)valwrite:'awriter->'a->unitDeferred.t(** Close a writer *)valclose:'awriter->unit(** Close a reader *)valclose_reader:'areader->unit(** Read one element from a reader. The function will block until an element becomes available or the
reader is closed, in which case [None] is returned *)valread:'areader->'aoptionDeferred.t(** Transfer all data from the reader to the writer. The function becomes determined when the reader or writer is closed *)valtransfer:'areader->'awriter->unitDeferred.t(** Return the state of a pipe *)valis_closed:('a,'b)pipe->bool(** Wait for a pipe to be closed. The function is determined once the pipe is closed.
the function can be called multiple times.
Note that not all elements may have been consumed yet.
*)valclosed:('a,'b)pipe->unitDeferred.tend(**/**)moduleNet:sigvalconnect:?connect_timeout_ms:int->inet:[`V4|`V6]->host:string->port:int->scheme:[<`Http|`Https]->unit->(stringPipe.reader*stringPipe.writer)Deferred.Or_error.tend(**/**)end