Skip to content
academia.sh

Unit 03 of 03

Application Services

Authentication and authorization, queues, events, notifications, caching, file storage, scheduled tasks, localization and testing — each as a mechanism that decides whether a piece of work runs in the request, later, or not at all.

Published Updated

Lessons

  1. 01 Authentication and Authorization Storing and verifying a password as a hash, the user in the session, the gate and the policy; a legitimate user asking to edit someone else's post, the gate returning 403 and the action being skipped; the principle that an undefined ability is denied. 2 min read
  2. 02 Queues and Jobs The job class, pushing onto a queue and the worker; a job pushed onto the queue being deferred at response time while the same job runs on the sync driver; a job that fails on its first attempt being retried and falling into the failed jobs list when its attempts run out. 2 min read
  3. 03 Events and Listeners The event, the listener and the dispatcher; separating side effects from the controller; a listener not being wired when the registered name does not match the dispatched name, a queued listener being deferred, and giving the event name as a class name catching the mismatch at registration. 2 min read
  4. 04 Notifications The notification class, the notification channel and the recipient's channel preference; the chosen synchronous channels running and the unchosen channel not being wired; the same channels being deferred when the notification is marked as queued. 2 min read
  5. 05 Caching The key-based cache, the time to live, the remember function and invalidation; the computation being skipped on a hit and running after invalidation; recomputation when the time to live ends, and the current record not reaching the response when invalidation is forgotten. 2 min read
  6. 06 File Storage The disk abstraction: the local disk and the in-memory disk behind the same interface; the same upload call running on two disks, a disk not named in the configuration not being wired, and a change of disk showing up in the life of the file and not in the response. 3 min read
  7. 07 Scheduled Tasks The recurring task definition, the frequency words and the scheduler tick; a task registered in a request running on the tick, a task whose time has not come being skipped on the tick, and the limit the tick interval puts on the task frequency. 3 min read
  8. 08 Localization Language arrays, placeholders, plural forms and the fallback language; the text of the requested language not being wired when the key is missing and the fallback language stepping in without an error, the requested language running when the key exists and the fallback language hiding a missing translation. 3 min read
  9. 09 Testing The feature test and the unit test, a small verification function; a job being recorded but not running in a fake queue, the job running once the queue is drained, and the fake queue not measuring the body of the job. 3 min read

Start typing to search.

↑↓ ↵ Esc navigate · open · close