Giter VIP home page Giter VIP logo

Comments (3)

to3m avatar to3m commented on August 16, 2024

Creating a VirtualTimeScheduler and passing it in as a parameter to the interval method fixed the prior attribute error but has resulted in a new one. Please see the output below...

import rx
vs = rx.concurrency.VirtualTimeScheduler()
rx.Observable.interval(1000, vs).subscribe(lambda x: print(x))
Traceback (most recent call last):
File "", line 1, in
File "c:\Python34\lib\site-packages\rx\observable.py", line 47, in subscribe
return self._subscribe(observer)
File "c:\Python34\lib\site-packages\rx\anonymousobservable.py", line 32, in _subscribe
if not auto_detach_observer.fail(ex):
File "c:\Python34\lib\site-packages\rx\abstractobserver.py", line 52, in fail
self.error(exn)
File "c:\Python34\lib\site-packages\rx\autodetachobserver.py", line 24, in error
self.observer.on_error(exn)
File "c:\Python34\lib\site-packages\rx\abstractobserver.py", line 34, in on_error
self.error(error)
File "c:\Python34\lib\site-packages\rx\internal\basic.py", line 24, in default_error
raise err
File "c:\Python34\lib\site-packages\rx\anonymousobservable.py", line 30, in _subscribe
auto_detach_observer.disposable = subscribe(auto_detach_observer)
File "c:\Python34\lib\site-packages\rx\linq\observable_time.py", line 136, in subscribe
return scheduler.schedule_periodic(period, action, state=0)
File "c:\Python34\lib\site-packages\rx\concurrency\virtualtimescheduler.py", line 64, in schedule_periodic
return scheduler.start()
File "c:\Python34\lib\site-packages\rx\concurrency\scheduleperiodicrecursive.py", line 36, in start
dis.disposable = self._scheduler.schedule_recursive_relative(self._period, self.tick, 0)
File "c:\Python34\lib\site-packages\rx\concurrency\scheduler.py", line 96, in schedule_recursive_relative
return self.schedule_relative(duetime, action1, state={ "first": state, "second": action })
File "c:\Python34\lib\site-packages\rx\concurrency\virtualtimescheduler.py", line 45, in schedule_relative
runat = self.add(self.clock, self.to_relative(duetime))
AttributeError: 'VirtualTimeScheduler' object has no attribute 'add'

from rxpy.

dbrattli avatar dbrattli commented on August 16, 2024

The VirtualTimeScheduler is virtual, so you need to use a subclass like the TestScheduler

from rxpy.

lock avatar lock commented on August 16, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from rxpy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.