Observation Chain

Patient Tools

Read, save, and share this guide

Use these quick tools to make this medical article easier to read, print, save, or share with a family member.

Article Summary

When discussing and documenting observables, it's important to have a common language and a known set of rules around what is going on. This document is an attempt to standardize these things so we can try to control the language in our docs, and hopefully other publications about RxJS, so we can discuss reactive programming with RxJS on consistent terms. While not all of the...

Key Takeaways

  • This article explains Major Entities in simple medical language.
  • This article explains Major Actions in simple medical language.
  • This article explains Major Concepts in simple medical language.
  • This article explains Minor Entities in simple medical language.
Educational health guideWritten for patient understanding and clinical awareness.
Reviewed content workflowUse writer and reviewer profiles for stronger trust.
Emergency safety firstUrgent warning signs are highlighted below.

Seek urgent medical care if you notice

These warning signs are general safety guidance. Local emergency numbers and clinical judgment should always come first.

  • Severe symptoms, breathing difficulty, fainting, confusion, or rapidly worsening illness.
  • New weakness, severe pain, high fever, or symptoms after a serious injury.
  • Any symptom that feels urgent, unusual, or unsafe for the patient.
1

Emergency now

Use emergency care for severe, sudden, rapidly worsening, or life-threatening symptoms.

2

See a doctor

Book a professional medical evaluation if symptoms persist, worsen, recur often, affect daily activities, or occur in a high-risk patient.

3

Learn safely

Use this article to understand possible causes, tests, treatment options, prevention, and questions to ask your clinician.

When discussing and documenting observables, it’s important to have a common language and a known set of rules around what is going on. This document is an attempt to standardize these things so we can try to control the language in our docs, and hopefully other publications about RxJS, so we can discuss reactive programming with RxJS on consistent terms.

While not all of the documentation for RxJS reflects this terminology, it is a goal of the team to ensure it does, and to ensure the language and names around the library use this document as a source of truth and unified language.

Major Entities

There are high level entities that are frequently discussed. It’s important to define them separately from other lower-level concepts, because they relate to the nature of observable.

Consumer

The code that is subscribing to the observable. This is whoever is being notified of nexted values, and errors or completions.

Producer

Any system or thing that is the source of values that are being pushed out of the observable subscription to the consumer. This can be a wide variety of things, from a WebSocket to a simple iteration over an Array. The producer is most often created during the subscribe action, and therefor “owned” by a subscription in a 1:1 way, but that is not always the case. A producer may be shared between many subscriptions, if it is created outside of the subscribe action, in which case it is one-to-many, resulting in a multicast.

Subscription

A contract where a consumer is observing values pushed by a producer. The subscription (not to be confused with the Subscription class or type), is an ongoing process that amounts to the function of the observable from the Consumer’s perspective. Subscription starts the moment a subscribe action is initiated, even before the subscribe action is finished.

Observable

The primary type in RxJS. At its highest level, an observable represents a template for connecting an Observer, as a consumer, to a producer, via a subscribe action, resulting in a subscription.

Observer

The manifestation of a consumer. A type that may have some (or all) handlers for each type of notification: next, error, and complete. Having all three types of handlers generally gets this to be called an “observer”, where if it is missing any of the notification handlers, it may be called a “partial observer”.

Major Actions

There are specific actions and events that occur between major entities in RxJS that need to be defined. These major actions are the highest level events that occur within various parts in RxJS.

Subscribe

The act of a consumer requesting from an Observable to set up a subscription so that it may observe a producer. A subscribe action can occur with an observable via many different mechanisms. The primary mechanism is the subscribe method on the Observable class. Other mechanisms include the forEach method, functions like lastValueFrom, and firstValueFrom, and the deprecated toPromise method.

Finalization

The act of cleaning up resources used by a producer. This is guaranteed to happen on errorcomplete, or if unsubscription occurs. This is not to be confused with unsubscription, but it does always happen during unsubscription.

Unsubscription

The act of a consumer telling a producer is is no longer interested in receiving values. Causes Finalization

Observation

A consumer reacting to next, error, or complete notifications. This can only happen during subscription.

Observation Chain

When an observable uses another observable as a producer, an “observation chain” is set up. That is a chain of observation such that multiple observers are notifying each other in a unidirectional way toward the final consumer.

Next

A value has been pushed to the consumer to be observed. Will only happen during subscription, and cannot happen after error, complete, or unsubscription. Logically, this also means it cannot happen after finalization.

Error

The producer has encountered a problem and is notifying the consumer. This is a notification that the producer will no longer send values and will finalize. This cannot occur after complete, any other error, or unsubscription. Logically, this also means it cannot happen after finalization.

Complete

The producer is notifying the consumer that it is done nexting values, without error, will send no more values, and it will finalize. Completion cannot occur after an error, or unsubscribe. Complete cannot be called twice. Complete, if it occurs, will always happen before finalization.

Notification

The act of a producer pushing nexted values, errors or completions to a consumer to be observed. Not to be confused with the Notification type, which is notification manifested as a JavaScript object.

Major Concepts

Some of what we discuss is conceptual. These are mostly common traits of behaviors that can manifest in observables or in push-based reactive systems.

Multicast

The act of one producer being observed by many consumers.

Unicast

The act of one producer being observed by only one consumer. An observable is “unicast” when it only connects one producer to one consumer. Unicast doesn’t necessarily mean “cold”.

Cold

An observable is “cold” when it creates a new producer during subscribe for every new subscription. As a result, “cold” observables are always unicast, being one producer observed by one consumer. Cold observables can be made hot but not the other way around.

Hot

An observable is “hot”, when its producer was created outside of the context of the subscribe action. This means that the “hot” observable is almost always multicast. It is possible that a “hot” observable is still technically unicast, if it is engineered to only allow one subscription at a time, however, there is no straightforward mechanism for this in RxJS, and the scenario is an unlikely one. For the purposes of discussion, all “hot” observables can be assumed to be multicast. Hot observables cannot be made cold.

Push

Observables are a push-based type. That means rather than having the consumer call a function or perform some other action to get a value, the consumer receives values as soon as the producer has produced them, via a registered next handler.

Pull

Pull-based systems are the opposite of push-based. In a pull-based type or system, the consumer must request each value the producer has produced manually, perhaps long after the producer has actually done so. Examples of such systems are Functions and Iterators

Minor Entities

Operator

A factory function that creates an operator function. Examples of this in rxjs are functions like map and mergeMap, which are generally passed to pipe. The result of calling many operators, and passing their resulting operator functions into pipe on an observable source will be another observable, and will generally not result in subscription.

Operator Function

A function that takes an observable, and maps it to a new observable. Nothing more, nothing less. Operator functions are created by operators. If you were to call an rxjs operator like map and put the return value in a variable, the returned value would be an operator function.

Operation

An action taken while handling a notification, as set up by an operator and/or operator function. In RxJS, a developer can chain several operator functions together by calling operators and passing the created operator functions to the pipe method of Observable, which results in a new observable. During subscription to that observable, operations are performed in an order dictated by the observation chain.

Stream

A “stream” or “streaming” in the case of observables, refers to the collection of operations, as they are processed during a subscription. This is not to be confused with node Streams, and the word “stream”, on its own, should be used sparingly in documentation and articles. Instead, prefer observation chain, operations, or subscription. “Streaming” is less ambiguous, and is fine to use given this defined meaning.

Source

An observable or valid observable input having been converted to an observable, that will supply values to another observable, either as the result of an operator or other function that creates one observable as another. This source, will be the producer for the resulting observable and all of its subscriptions. Sources may generally be any type of observable.

Observable Inputs

An “observable input” (defined as a type here), is any type that can be easily converted to an Observable. Observable Inputs may sometimes be referred to as “valid observable sources”.

Notifier

An observable that is being used to notify another observable that it needs to perform some action. The action should only occur on a next notification, and never on error or complete. Generally, notifiers are used with specific operators, such as takeUntilbuffer, or delayWhen. A notifier may be passed directly, or it may be returned by a callback.

Inner Source

One, of possibly many sources, which are subscribed to automatically within a single subscription to another observable. Examples of an “inner source” include the observable inputs returned by the mapping function in a mergeMap operator. (e.g. source.pipe(mergeMap(value => createInnerSource(value))), where createInnerSource returns any valid observable input).

Partial Observer

An observer that lacks all necessary notification handlers. Generally these are supplied by user-land consumer code. A “full observer” or “observer” would simply be an observer that has all notification handlers.

Other Concepts

Unhandled Errors

An “unhandled error” is any error that is not handled by a consumer-provided function, which is generally provided during the subscribe action. If no error handler was provided, RxJS will assume the error is “unhandled” and rethrow the error on a new callstack to prevent “producer interference”.

Producer Interference

Producer interference happens when an error is allowed to unwind the RxJS callstack during notification. When this happens, the error could break things like for-loops in upstream sources that are notifying consumers during a multicast. That would cause the other consumers in that multicast to suddenly stop receiving values without logical explanation. As of version 6, RxJS goes out of its way to prevent producer interference by ensuring that all unhandled errors are thrown on a separate callstack.

Upstream And Downstream

The order in which notifications are processed by operations in a stream have a directionality to them. “Upstream” refers to an operation that was already processed before the current operation, and “downstream” refers to an operation that will be processed after the current operation.

Patient safety assistant

Check your symptom safely

Hi, I am RX Symptom Navigator. I can help you understand what to read next and what warning signs need care.
Warning: Do not use this in emergencies, pregnancy, severe illness, or as a substitute for a doctor. For children or teens, use with a parent/guardian and clinician.
A rural-friendly guide: warning signs, when to see a doctor, related articles, tests to discuss, and OTC safety education.
1 Symptom 2 Severity 3 Safe guidance
First safety question

Is there chest pain, breathing trouble, fainting, confusion, severe bleeding, stroke-like weakness, severe injury, or pregnancy danger sign?

Choose quickly

Browse by body area
Start here: Write or select a symptom. The guide will show warning signs, doctor guidance, diagnostic tests to discuss, OTC safety education, and related RX articles.

Important: This tool is educational only. It cannot diagnose, treat, or replace a doctor. OTC information is not a prescription. In an emergency, contact local emergency services or go to the nearest hospital.

Doctor visit helper

Prepare before seeing a doctor

A simple rural-patient checklist to help you explain symptoms clearly, ask better questions, and avoid unsafe self-treatment.

Safety note: This is not a prescription or diagnosis. For severe symptoms, pregnancy danger signs, children with serious illness, chest pain, breathing difficulty, stroke-like weakness, or major injury, seek urgent care.

Which doctor may help?

Start with a registered doctor or the nearest qualified health center.

What to tell the doctor

  • Write when the problem started and how it changed.
  • Bring old prescriptions, investigation reports, and current medicines.
  • Write allergies, pregnancy status, diabetes, kidney/liver disease, and major past illnesses.
  • Bring one family member if the patient is weak, elderly, confused, or a child.

Questions to ask

  • What is the most likely cause of my symptoms?
  • Which danger signs mean I should go to hospital quickly?
  • Which tests are necessary now, and which can wait?
  • How should I take medicines safely and what side effects should I watch for?
  • When should I come for follow-up?

Tests to discuss

  • Vital signs: temperature, pulse, blood pressure, oxygen saturation
  • Basic physical examination by a clinician
  • CBC, urine test, blood sugar, or imaging only when clinically needed

Avoid these mistakes

  • Do not use antibiotics, steroid tablets/injections, or strong painkillers without proper medical advice.
  • Do not hide pregnancy, kidney disease, ulcer, allergy, or blood thinner use.
  • Do not delay emergency care when danger signs are present.

Medicine safety and first-aid guide

This section is for patient education only. It does not replace a doctor, pharmacist, or emergency care.

Safe first steps

  • Avoid heavy lifting, sudden bending, and prolonged bed rest.
  • Use comfortable posture and gentle movement as tolerated.
  • Discuss physiotherapy, X-ray, or MRI only when clinically needed.

OTC medicine safety

  • For mild back pain, pain-relief medicine may be discussed with a doctor or pharmacist.
  • Avoid repeated painkiller use if you have kidney disease, stomach ulcer, uncontrolled blood pressure, or are taking blood thinners.

Avoid these mistakes

  • Do not start antibiotics without a proper medical decision.
  • Do not use steroid tablets or injections casually for quick relief.
  • Do not delay emergency care because of home remedies.

Get urgent help if

  • Back pain with leg weakness, numbness around private area, loss of urine/stool control, fever, cancer history, or major injury needs urgent care.
Medicine names, dose, and timing must be decided by a qualified clinician or pharmacist after checking age, pregnancy, allergy, other diseases, and current medicines.

For rural patients and family caregivers

Patient health record and symptom diary

Write your symptoms, medicines already taken, test results, and questions before visiting a doctor. This note stays on your device unless you print or copy it.

Doctor to discuss: Doctor / qualified healthcare provider
Tests to discuss with doctor
  • Basic vital signs: temperature, pulse, blood pressure, oxygen level if needed
  • Relevant blood, urine, imaging, or specialist tests only after clinical assessment
Questions to ask
  • What is the most likely cause of my symptoms?
  • Which warning signs mean I should go to emergency care?
  • Which tests are really needed now?
  • Which medicines are safe for my age, pregnancy status, allergy, kidney/liver/stomach condition, and current medicines?

Emergency warning signs such as chest pain, severe breathing difficulty, sudden weakness, confusion, severe dehydration, major injury, or loss of bladder/bowel control need urgent medical care. Do not wait for online information.

Safe pathway to proper treatment

Back pain care roadmap

Use this simple roadmap to understand the next safe steps. It is educational and does not replace examination by a doctor.

Go to emergency care if you notice:
  • New leg weakness, numbness around private area, or loss of bladder/bowel control
  • Back pain after major injury, fever, unexplained weight loss, cancer history, or severe night pain
Doctor / service to discuss: Orthopedic/spine specialist, physical medicine doctor, physiotherapist under guidance, or qualified clinician.
  1. Step 1

    Check danger signs first

    If danger signs are present, seek emergency care and do not wait for online information.

  2. Step 2

    Record the symptom story

    Write when symptoms started, severity, medicines already taken, allergies, pregnancy status, and test results.

  3. Step 3

    Visit a qualified clinician

    A doctor, nurse, or qualified healthcare provider can examine you and decide which tests or treatment are needed.

  4. Step 4

    Do only useful tests

    Discuss neurological examination first. X-ray or MRI may be needed only when red flags, injury, nerve weakness, or persistent severe symptoms are present.

  5. Step 5

    Follow up and return early if worse

    If symptoms worsen, new warning signs appear, or treatment is not helping, return for review quickly.

Rural patient practical tips
  • Take a written symptom diary and all previous prescriptions/test reports.
  • Do not hide medicines already taken, even herbal or over-the-counter medicines.
  • Ask which warning signs mean urgent referral to hospital.
  • Avoid forceful massage or bone-setting when there is weakness, injury, fever, or nerve symptoms.

This roadmap is for education. A real diagnosis and treatment plan requires history, examination, and clinical judgment.

RX Patient Help

Ask a health question safely

Write your symptom story. A health professional or site editor can review it before any answer is prepared. This box is not for emergency care.

Emergency first: Severe chest pain, breathing trouble, unconsciousness, stroke signs, severe injury, heavy bleeding, or rapidly worsening symptoms need urgent local medical care now.

Frequently Asked Questions

Is this article a replacement for a doctor?

No. It is educational content only. Patients should consult a qualified clinician for diagnosis and treatment.

When should I seek urgent care?

Seek urgent care for severe symptoms, rapidly worsening condition, breathing difficulty, severe pain, neurological changes, or any emergency warning sign.

References

Add references, clinical guidelines, textbooks, journal articles, or trusted medical sources here. You can edit this area from the RX Article Professional Blocks panel.