CCSDS 521.0-B-1 Mission Operations Message Abstraction Layer (MAL)
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

ocaml-linkedin: apply dune fmt

Pure formatting changes from `dune fmt`: doc comment placement moves
from above the binding to below it for `type`s, multi-line `match`
expressions collapse onto one line where they fit, and infix operator
applications pick up spaces (`Soup.($?)` -> `Soup.( $? )`). No
semantic changes.

+38 -20
+32 -20
README.md
··· 16 16 17 17 ## Installation 18 18 19 + Install with opam: 20 + 21 + ```shell 22 + $ opam install mal 19 23 ``` 20 - opam install mal 24 + 25 + If opam cannot find the package, it may not yet be released in the public 26 + `opam-repository`. Add the overlay repository, then install it: 27 + 28 + ```shell 29 + $ opam repo add samoht https://tangled.org/gazagnaire.org/opam-overlay.git 30 + $ opam update 31 + $ opam install mal 21 32 ``` 22 33 23 34 ## Usage 24 35 25 36 ```ocaml 26 - (* Create an in-memory transport for testing *) 27 - let provider = Mal.Mem_transport.create "mal:provider" in 28 - let consumer = Mal.Mem_transport.create "mal:consumer" in 29 - 30 - (* Build a Request message *) 31 - let tid = Mal.next_transaction_id () in 32 - let msg = 33 - Mal.header 34 - ~uri_from:"mal:consumer" ~uri_to:"mal:provider" 35 - ~interaction_type:Request ~stage:Request_stage 36 - ~transaction_id:tid ~area:1 ~service:1 ~operation:1 37 - ~body:"ping" () 38 - in 39 - 40 - (* Send and dispatch *) 41 - let _ = Mal.Mem_transport.send consumer msg in 42 - match Mal.Mem_transport.recv provider with 43 - | Ok received -> Printf.printf "Got: %s\n" received.body 44 - | Error code -> Fmt.pr "Error: %a\n" Mal.pp_error_code code 37 + let run () = 38 + (* Create an in-memory transport for testing *) 39 + let provider = Mal.Mem_transport.create "mal:provider" in 40 + let consumer = Mal.Mem_transport.create "mal:consumer" in 41 + (* Build a Request message *) 42 + let tid = Mal.next_transaction_id () in 43 + let msg = 44 + Mal.header 45 + ~uri_from:"mal:consumer" ~uri_to:"mal:provider" 46 + ~interaction_type:Mal.Request ~stage:Mal.Request_stage 47 + ~transaction_id:tid ~area:1 ~service:1 ~operation:1 48 + ~body:"ping" () 49 + in 50 + (* Send and dispatch *) 51 + let _ = Mal.Mem_transport.send consumer msg in 52 + (match Mal.Mem_transport.recv provider with 53 + | Ok received -> Printf.printf "Got: %s\n" received.Mal.body 54 + | Error code -> Fmt.pr "Error: %a\n" Mal.pp_error_code code); 55 + Mal.Mem_transport.close provider; 56 + Mal.Mem_transport.close consumer 45 57 ``` 46 58 47 59 ## API Overview
+3
dune
··· 1 + (mdx 2 + (files README.md) 3 + (libraries mal fmt))
+2
dune-project
··· 1 1 (lang dune 3.21) 2 + (using mdx 0.4) 2 3 3 4 (name mal) 4 5 ··· 19 20 (depends 20 21 (ocaml (>= 5.1)) 21 22 (fmt (>= 0.9)) 23 + (mdx :with-test) 22 24 (alcotest :with-test)))
+1
mal.opam
··· 13 13 "dune" {>= "3.21"} 14 14 "ocaml" {>= "5.1"} 15 15 "fmt" {>= "0.9"} 16 + "mdx" {with-test} 16 17 "alcotest" {with-test} 17 18 "odoc" {with-doc} 18 19 ]