Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

txaio.time_ns requires networking framework selection #173

Open
oberstet opened this issue Mar 16, 2021 · 1 comment
Open

txaio.time_ns requires networking framework selection #173

oberstet opened this issue Mar 16, 2021 · 1 comment

Comments

@oberstet
Copy link
Contributor

The WAMP IDL code generator (xbrnetwork CLI included with Autobahn) currently generates code that imports txaio and select Twisted. When writing asyncio programs, this is inconvenient. The problem is time_ns:

(cpy392_1) oberstet@intel-nuci7:~$ python
Python 3.9.2 (default, Mar  8 2021, 02:05:12) 
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from txaio import time_ns
>>> time_ns()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/oberstet/scm/crossbario/txaio/txaio/_unframework.py", line 41, in _throw_usage_error
    raise RuntimeError(
RuntimeError: To use txaio, you must first select a framework with .use_twisted() or .use_asyncio()
>>> 

We either need a way to use txaio.time_ns without selecting a networking framework, or we need to move the helper eg to zLMDB.

@meejah
Copy link
Contributor

meejah commented Mar 16, 2021

Kind of the whole premise of txaio is "select things via imports" .. now, those are usually like the autobahn.wamp.{twisted,asyncio} method (the .use_*() calls are in there) but ... might be expedient to just move / duplicate it..?

...but also, it seems it's only there to support Python versions less than 3.7 -- above that it's time.time_ns()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants