Slots in Repository Services

When playing a slot machine, you place a coin or, in “ticket-in, ticket-out” machines, a paper ticket with a barcode into a designated slot on the machine. This activates reels that display symbols and, if a winning combination appears, credits are awarded according to the pay table on the machine’s face or help screen. Symbols vary depending on the theme of the machine. Some slots also feature a Wild symbol that can substitute for other symbols to form a winning line.

A slot is a dynamic placeholder that either waits for content (a passive slot) or calls out to the repository to receive it (an active slot). The slots are connected to the repositories through signals that can be emitted by any class, regardless of its access level. Signals connected to slots incur a slight overhead, approximately ten times the cost of emitting a non-virtual function call to the receivers that the signal is attached to; this cost is primarily due to the time required to locate the connection object and to safely iterate over all the slots in a generic fashion.

Using slots makes it easy to create different environments for testing and staging, and provides for fast deployments of HTTP-triggered workloads. It is also a great way to prewarm apps prior to swapping them into production, and provides an easy fallback in case the swap fails. In addition, the slot mechanism is useful for reducing latency in functions that are triggered by HTTP requests.

Posted on