Eventual API design

3 views
Skip to first unread message

Dale Schumacher

unread,
Jan 4, 2023, 12:00:33 PM1/4/23
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
Forward
0 new messages