Eventual API design

Skip to first unread message

Dale Schumacher

Jan 4, 2023, 12:00:33 PMJan 4
to fr...@googlegroups.com
I'd like to suggest the design of eventual APIs as a potential topic for friam. There seem to be several reasonable approaches, so a discussion of the pros and cons could be productive. Some approaches include:
  • single-customer, functions made "total" by adding undefined.
  • dual-customer (e.g.: ok/fail) for async flow-control.
  • single-customer, results wrapped in ok/fail sum-type.
  • single-customer, result promise, eventual ok/fail (may throw?).
Of course there are variations even among these categories, and probably other approaches I haven't listed. Parseq is a very nice overall design that adds timeout and cancellation, which are important features missing from most other implementations. I put Parseq in the "ok/fail sum-type" category.

Reply all
Reply to author
0 new messages