Skip to content

Devis 4: promises, async handlers, timeouts and parallel calls - #53

Merged
ismailrei merged 2 commits into
masterfrom
v4
Nov 3, 2026
Merged

ismailrei merged 2 commits into
masterfrom
v4

Conversation

@ismailrei

Copy link
Copy Markdown
Member

Summary

  • call() returns a Promise when no callback is given; handlers can be async (return a value or throw).
  • Pattern key order no longer matters.
  • Calls on one connection run in parallel. They fail with request timed out (new timeout connect option, 30 s default) or connection closed instead of waiting forever.
  • Remote results 0, "" and null reach the caller (3.x reported them as No handle found).
  • call() no longer mutates the caller's pattern and args.
  • close() without an id stops every server and connection, for graceful shutdown.
  • setLogger() routes logs to any { info, error } logger, or silences them with null.
  • TypeScript declarations (devis.d.ts), type-checked by npm test.
  • jsonet is replaced by a small framing module: jsonet reused one header buffer, so frames written before the socket connected corrupted each other (50 such writes: 0 received intact). The wire format is unchanged.
  • usePath (Wakanda only) and getFunctions are removed.

Test plan

  • npm test: 53 mocha tests + tsc --noEmit --strict
  • New tests fail on 3.0.2
  • Wire interop checked both ways against devis 3.0.2 from npm
  • README quick start run against this branch

- call() returns a Promise without a callback; handlers can be async
- Pattern key order no longer matters
- Calls on one connection run in parallel; they fail with "request
  timed out" (connect timeout option, 30 s default) or "connection
  closed" instead of waiting forever
- Remote results 0, "" and null reach the caller
- call() no longer mutates the caller's pattern and args
- close() without an id stops every server and connection
- setLogger() routes or silences logs
- TypeScript declarations, checked by npm test
- Replace jsonet: its shared header buffer corrupted frames written
  while connecting; the wire format is unchanged
- Remove usePath (Wakanda only) and getFunctions
@ismailrei
ismailrei merged commit 10ec0d2 into master Nov 3, 2026
3 checks passed
@ismailrei
ismailrei deleted the v4 branch November 3, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant