Plasma GitLab Archive
Projects Blog Knowledge

Module Mapred_rfun

module Mapred_rfun: sig .. end
Registered functions (low-level)


Registered functions get a unique ID, and can be invoked remotely on the task nodes. On this low-level, the registration procedure is unsafe. See Mapred_toolkit for how to use it safely.
type ('a -> 'b) rfun 
A registered function has this type. The argument must be a function type, e.g (int -> string) rfun.

An rfun is marshallable.

exception Rfun_not_found of string
The named registered function is not found
val register : string -> ('a -> 'b) -> ('a -> 'b) rfun
register name f: Registers the function f under name. The name must be unique, and must not start with an underscore.

Registrations are only possible in the initialization phase of the program, because they must be done identically in all running instances of the program (i.e. on all task nodes).

val finish : unit -> unit
Disables further registrations (at the end of the initialization).
val lookup : ('a -> 'b) rfun -> 'a -> 'b
Returns a registered function
val get_id : ('a -> 'b) rfun -> string
Returns the ID
val apply_partially : ('a -> 'b -> 'c) rfun -> 'a -> ('b -> 'c) rfun
Create a new rfun by applying the first argument only. Note that the argument needs to be marshallable!
val p4_new_file : (unit -> unit) -> unit
Used in mapred.mlp to announce a new source file
val p4_register : (unit -> unit) -> ('a -> 'b) -> ('a -> 'b) rfun
Used in mapred.mlp to register a function with an automatic name
This web site is published by Informatikbüro Gerd Stolpmann
Powered by Caml