Permalink
Browse files

Expose streaming parsing and printing functions for json

This allows clients to avoid buffering large intermediate strings.
  • Loading branch information...
1 parent 197c9dc commit e6d6ff879a7552b99cdd1fa73e13b66185552052 David Scott committed Oct 24, 2012
Showing with 5 additions and 0 deletions.
  1. +2 −0 lib/jsonrpc.ml
  2. +3 −0 lib/jsonrpc.mli
View
@@ -480,6 +480,8 @@ module Parser = struct
of_stream next
end
+let of_fct = Parser.of_stream
+
let of_string = Parser.of_string
exception Malformed_method_request of string
View
@@ -15,6 +15,9 @@
val to_string : Rpc.t -> string
val of_string : string -> Rpc.t
+val to_fct : Rpc.t -> (string -> unit) -> unit
+val of_fct : (unit -> char) -> Rpc.t
+
val string_of_call: Rpc.call -> string
val call_of_string: string -> Rpc.call

0 comments on commit e6d6ff8

Please sign in to comment.