import jakarta.persistence.*;
import java.math.BigDecimal;
import java.util.Objects;
@Entity
@Table(name = "accounts")
module EventBus
@subscribers = Hash.new { |h, k| h[k] = [] }
class << self
def subscribe(event_class, handler = nil, &block)
callable = handler || block
package hub
type Hub struct {
subscribers map[*Subscriber]struct{}
broadcast chan []byte
register chan registration
class Article < ApplicationRecord
include PgSearch::Model
pg_search_scope :full_text_search,
against: { title: 'A', body: 'B' },
using: {
const RETRYABLE_STATUS = new Set([408, 429, 500, 502, 503, 504]);
export function fullJitter(attempt, baseDelay = 300, maxDelay = 10_000) {
const ceiling = Math.min(maxDelay, baseDelay * 2 ** attempt);
return Math.random() * ceiling;
}