123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125# 1 "src/lib/eliom_comet_base.shared.ml"(* Ocsigen
* http://www.ocsigen.org
* Copyright (C) 2010-2011
* Raphaël Proust
* Pierre Chambart
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, with linking exception;
* either version 2.1 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*)type'achan_id=stringexternalstring_of_chan_id:'achan_id->string="%identity"externalchan_id_of_string:string->'achan_id="%identity"[@@@warning"-39"]typeposition=|Newestofint|Afterofint|Lastofintoption(* None means this is a 'newest channel' *)[@@derivingjson]typecomet_stateless_request=(string*position)array[@@derivingjson]typecommand=Registerofstring|Closeofstring[@@derivingjson]typecomet_stateful_request=Request_dataofint|Commandsofcommandarray[@@derivingjson]typecomet_request=|Statelessofcomet_stateless_request|Statefulofcomet_stateful_request[@@derivingjson]type'achannel_data=Dataof'a|Full|Closed[@@derivingjson]typeanswer=|Stateless_messagesof(string*(string*int)channel_data)array|Stateful_messagesof(string*stringchannel_data)array|Timeout|State_closed|Comet_errorofstring[@@derivingjson][@@@warning"+39"]letcomet_request_param=Eliom_parameter.ocaml"comet_request"[%json:comet_request]typecomet_service=|Comet_service:(unit,bool*comet_request,Eliom_service.post,Eliom_service.att,_,_,_,[`WithoutSuffix],unit,[`Oneofbool]Eliom_parameter.param_name*[`Oneofcomet_requestEliom_parameter.ocaml]Eliom_parameter.param_name,Eliom_service.non_ocaml)Eliom_service.t*commandlistref->comet_servicetypeinternal_comet_service=|Internal_comet_service:(unit,bool*comet_request,Eliom_service.post,Eliom_service.att,_,Eliom_service.non_ext,Eliom_service.reg,[`WithoutSuffix],unit,[`Oneofbool]Eliom_parameter.param_name*[`Oneofcomet_requestEliom_parameter.ocaml]Eliom_parameter.param_name,Eliom_service.non_ocaml)Eliom_service.t*commandlistref->internal_comet_servicetypestateless_kind=|After_kindofint|Newest_kindofint|Last_kindofintoptiontype'awrapped_channel=|Stateful_channelof(comet_service*'achan_id)|Stateless_channelof(comet_service*'achan_id*stateless_kind)type'abus_send_service=|Bus_send_service:(unit,'alist,Eliom_service.post,Eliom_service.non_att,Eliom_service.co,Eliom_service.non_ext,Eliom_service.reg,[`WithoutSuffix],unit,[`Oneof'alistEliom_parameter.ocaml]Eliom_parameter.param_name,Eliom_service.non_ocaml)Eliom_service.t->'abus_send_servicetype('a,'b)wrapped_bus='bwrapped_channel*'abus_send_service