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 rolePermissions = {
guest: ['article:read'],
author: ['article:read', 'article:create', 'article:update:own'],
editor: ['article:publish', 'article:update:any'],
admin: ['user:manage', 'role:assign']
};
require 'digest'
require 'json'
module CacheHelpers
def cache_control_public(max_age = 60)
cache_control :public, :must_revalidate, max_age: max_age
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;
}