rxpy observablesobservers and subjects the observer class must ensure that the methods implemented adhere to the observer protocol ( that the signatures of the on_next()on_completed (and on_error(methods are correct multiple subscribers/observers an observable can have multiple observers subscribed to it in this case each of the observers is sent all of the data published by the observable multiple observers can be registered with an observable by calling the subscribe method multiple times for examplethe following program has four subscribers as well as on_error and on_completed function registeredcreate an observable using data in list observable rx from_list([ ]class primenumberobserver""an observer class ""def on_next(selfvalue)print('object received'valuedef on_completed(self)print('data stream completed'def on_error(selferror)print('error occurred'errordef prime_number_reporter(value)print('function received'valueprint('set up observers subscribers'subscribe lambda function observable subscribe(lambda valueprint('lambda received'value)subscribe named function observable subscribe(prime_number_reportersubscribe an observer object observable subscribe(primenumberobserver()use lambdas to set up all three functions observable subscribeon_next=lambda valueprint('received on_next'value)on_error=lambda expprint('error occurred'exp)on_completed=lambdaprint('received completed notification'