1. james woodyatt
  2. oni

Commits

jhwoodyatt  committed 99e20a2

Checkpoint. Add plugs and jacks for Mime_stream reactors.

  • Participants
  • Parent commits 70b9204
  • Branches default

Comments (0)

Files changed (3)

File mime/mime_stream.ml

View file
  • Ignore whitespace
     inherit ['event] emitter ?limits flowTx mimeRx bodyTx
 end
 
+type iplug =
+    (Iom_octet_stream.fragment, Iom_stream.flowcontrol, Iom_stream.failed)
+    Iom_stream.ijack
+
+type oplug =
+    (Iom_octet_stream.fragment, Iom_stream.stop, Iom_stream.flownotify)
+    Iom_stream.ojack
+
+type ioplug =
+    (Iom_octet_stream.fragment, Iom_octet_stream.fragment,
+    Iom_stream.flowcontrol, Iom_stream.flownotify) Iom_stream.iojack
+
+type 'i ijack =
+    ('i event, Iom_stream.flowcontrol, Iom_stream.failed)
+    Iom_stream.ijack constraint 'adapter = #Mime_entity.basic_scan_adapter
+
+type 'o ojack =
+    ('o event, Iom_stream.stop, Iom_stream.flownotify)
+    Iom_stream.ojack constraint 'adapter = #Mime_entity.basic_emit_adapter
+
+type ('i, 'o) iojack =
+    ('i event, 'o event, Iom_stream.flowcontrol, Iom_stream.flownotify)
+    Iom_stream.iojack constraint 'adapter = #Mime_entity.basic_emit_adapter
+
+type entity_scanner_jack = Mime_entity.basic_scan_adapter ijack
+type entity_emitter_jack = Mime_entity.basic_emit_adapter ojack
+type entity_iojack =
+    (Mime_entity.basic_scan_adapter, Mime_entity.basic_emit_adapter) iojack
+
 (*--- End of File [ mime_stream.ml ] ---*)

File mime/mime_stream.mli

View file
  • Ignore whitespace
         inherit ['event] emitter
     end
 
+(*---------------------------------------------------------------------------*
+  PLUGS and JACKS
+ *---------------------------------------------------------------------------*)
+type iplug =
+    (Iom_octet_stream.fragment, Iom_stream.flowcontrol, Iom_stream.failed)
+    Iom_stream.ijack
+
+type oplug =
+    (Iom_octet_stream.fragment, Iom_stream.stop, Iom_stream.flownotify)
+    Iom_stream.ojack
+
+type ioplug =
+    (Iom_octet_stream.fragment, Iom_octet_stream.fragment,
+    Iom_stream.flowcontrol, Iom_stream.flownotify) Iom_stream.iojack
+
+type 'i ijack =
+    ('i event, Iom_stream.flowcontrol, Iom_stream.failed)
+    Iom_stream.ijack constraint 'adapter = #Mime_entity.basic_scan_adapter
+
+type 'o ojack =
+    ('o event, Iom_stream.stop, Iom_stream.flownotify)
+    Iom_stream.ojack constraint 'adapter = #Mime_entity.basic_emit_adapter
+
+type ('i, 'o) iojack =
+    ('i event, 'o event, Iom_stream.flowcontrol, Iom_stream.flownotify)
+    Iom_stream.iojack constraint 'adapter = #Mime_entity.basic_emit_adapter
+
+type entity_scanner_jack = Mime_entity.basic_scan_adapter ijack
+type entity_emitter_jack = Mime_entity.basic_emit_adapter ojack
+type entity_iojack =
+    (Mime_entity.basic_scan_adapter, Mime_entity.basic_emit_adapter) iojack
+
 (*--- End of File [ mime_stream.mli ] ---*)

File mime/t/t_mime.ml

View file
  • Ignore whitespace
     
     let test () =
         Iom_gadget.run reactor;
-        if not !finished then jout#fail "T4: reaction incomplete!"
+        if not !finished then jout#fail "T5: reaction incomplete!"
 end
 
 let main () =