DpExchange.Schwab.Supervisor (DpExchangeSchwab v0.1.3)

Copy Markdown View Source

This venue's process tree — internal.

A limiter and a feed, exactly as every other venue in the family, even though the feed behind them is a poll rather than a socket. That sameness is the point: a consumer's supervision tree looks identical whichever venue it holds.

The limiter is configured, not declared

Every other venue in the family takes its limits from capabilities/0. This one cannot: Schwab's documented ceiling is 0..120 order writes per minute per account, set per application at registration, so there is no venue constant to read. A number baked in here would be a claim about somebody else's registration.

So the limits come from options, and the default is deliberately generous for reads — which the venue documents as unthrottled — while a host that places orders should pass :order_limit_per_minute matching what its own app was registered with. Zero is a legal registration value, and a host with it should pass 0 rather than discover the ceiling by being refused.

Summary

Functions

Returns a specification to start this module under a supervisor.

Default read ceiling, which is a courtesy rather than a measurement.

This venue's feed process.

The limiter this venue meters against.

The limits this tree meters with.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

default_read_limit()

@spec default_read_limit() :: pos_integer()

Default read ceiling, which is a courtesy rather than a measurement.

feed_name(opts)

@spec feed_name(keyword()) :: atom()

This venue's feed process.

limiter_name(opts)

@spec limiter_name(keyword()) :: atom()

The limiter this venue meters against.

limits(opts)

@spec limits(keyword()) :: map()

The limits this tree meters with.

:read_limit_per_minute defaults to 120; :order_limit_per_minute has no default, because the venue has no default — see the moduledoc.

start_link(opts)

@spec start_link(keyword()) :: Supervisor.on_start()