Skip to content

changing behavior of interval function #221

Open
@ehsanhrz

Description

@ehsanhrz

i created a new observable by extending AbstractObservable . later on, i tried interval operation on the new object but this operation ignores the behavior of my own object and returns IntervalObservable. this makes my own functionality obsolete and makes it useless. I'm suggesting to change the behavior of the operator ; to don't return a IntervalObservable if i calling this method from my own observable . i think we can do this by defining new parameter to the operator witch is null able. this new parameter defines the type of the observable that i want to return. or we can change the functionality of the operator by defining new way. in this new way the interval operation wont return new different object .rather it modifies the behavior of the subscribe function itself .

class Observable extends RxObservable
{
    
    public function AA(): void
    {
        printf("i'm AA coming from observable object\n");
    }

    public function BB(): void
    {
        printf("i'm BB coming from observable object\n");
    }

    public function CC(): void
    {
        printf("i'm CC coming from observable object\n");
    }

    protected function _subscribe(ObserverInterface $observer): DisposableInterface
    {
        
        try
        {
            
            $this->AA();
            $this->BB();
            $this->CC();
            $observer->onNext("call the completed function\n");
            $observer->onCompleted();
            $disposable = new EmptyDisposable();
            return $disposable;
        }
        catch(Exception $e)
        {
            printf("this is the error: ".$e);
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions