Repository navigation
Give resident adapters the host's ServerlessOptions - #181
Conversation
A classic adapter gets the host's ServerlessOptions on argv[1] and reads it through Runner.ServerlessOptions, e.g. its cloud-files settings to fetch an attachment from the host's storage. A resident process never got it, so Runner.ServerlessOptions stayed null and such an adapter threw the first time it read it (Traxis's DHL label adapter reads it on every call). Ready now carries it as JSON (serverless_options, field 4), over the socket as the startup values already are, so it stays off the command line. ResidentAdapterHost takes the registered ServerlessOptions (optional; none sends nothing), and the SDK sets Runner.ServerlessOptions from Ready, falling back to defaults when the host sent none, as the classic runner does when argv[1] can't be read. An adapter built before this ignores the field; a host built before sends none. Test: the Ticker sample, resident, reads the host's AdapterRemotePath through Runner.ServerlessOptions. Resident tests 16/16 and compatibility tests 29/29 pass. The full unit suite has the same 7 classic/describe failures on unmodified main on this machine; they pass alone.
|
Caution Review failedThe pull request is closed. 📝 Summary
Merge Risk:
|
A classic adapter gets the host's
ServerlessOptionson argv[1] and reads it asRunner.ServerlessOptions, for example its cloud-files settings to fetch an attachment from the host's storage. A resident process never got it, soRunner.ServerlessOptionsstayednullthere, and an adapter that reads it threw on first use. Traxis's DHL label adapter reads it on every call, which is what blocks DHL from going resident.Change
Readygetsstring serverless_options = 4: the host'sServerlessOptionsas JSON, the same content classic sends on argv[1]. It goes over the socket like the startup values, so it stays off the command line.ResidentAdapterHosttakes the registeredServerlessOptions. The constructor parameter is optional; with none registered, nothing is sent.Runner.ServerlessOptionsfromReady. If the host sent none, it falls back to defaults, as the classic runner does when argv[1] can't be read.docs/protocol.mddocuments the field.Compatibility
Tests
The_hosts_serverless_options_reach_the_runner. The Ticker sample, running resident, reads the host'sAdapterRemotePaththroughRunner.ServerlessOptions.mainhere and pass when run alone, so they're local test-environment issues, not this change.