Made BMConnectionPool as global runtime variable in connectionpool from singleton #2220

Merged
anand-skss merged 1 commits from test2 into v0.6 2024-05-09 16:33:22 +02:00
anand-skss commented 2024-05-01 06:17:07 +02:00 (Migrated from github.com)
  • Made BMConnectionPool as global runtime variable in connectionpool from singleton
  • Moved announcethread and connectionpool imports into start function
* Made BMConnectionPool as global runtime variable in connectionpool from singleton * Moved announcethread and connectionpool imports into start function
PeterSurda (Migrated from github.com) requested changes 2024-05-02 05:18:56 +02:00
PeterSurda (Migrated from github.com) commented 2024-05-02 05:04:56 +02:00

If we don't conditionally import the connection pool then this check isn't necessary anymore.

If we don't conditionally import the connection pool then this check isn't necessary anymore.
@ -2,21 +2,17 @@
Network subsystem package
"""
PeterSurda (Migrated from github.com) commented 2024-05-02 05:13:02 +02:00

how about we use a different name for the object than the class name? How about network.connectionpool for instance and we keep network.BMConnectionPool as the class name?

how about we use a different name for the object than the class name? How about `network.connectionpool` for instance and we keep `network.BMConnectionPool` as the class name?
PeterSurda (Migrated from github.com) commented 2024-05-02 05:14:58 +02:00

I'm not sure this try/except is needed anymore once we fix the circular imports.

I'm not sure this try/except is needed anymore once we fix the circular imports.
@ -19,2 +13,4 @@
import state
from .announcethread import AnnounceThread
import connectionpool # pylint: disable=relative-import
from .addrthread import AddrThread
PeterSurda (Migrated from github.com) commented 2024-05-02 05:16:03 +02:00

I think we can use the object name here, i.e. connectionpool as I recommended above.

I think we can use the object name here, i.e. `connectionpool` as I recommended above.
PeterSurda (Migrated from github.com) commented 2024-05-02 05:16:56 +02:00

why not from network import connectionpool?

why not `from network import connectionpool`?
PeterSurda (Migrated from github.com) commented 2024-05-02 05:17:24 +02:00

again here we could use from network import connectionpool

again here we could use `from network import connectionpool`
anand-skss (Migrated from github.com) reviewed 2024-05-02 10:12:54 +02:00
@ -2,21 +2,17 @@
Network subsystem package
"""
anand-skss (Migrated from github.com) commented 2024-05-02 10:12:54 +02:00

done, renamed as pool

done, renamed as pool
anand-skss (Migrated from github.com) reviewed 2024-05-03 04:35:58 +02:00
anand-skss (Migrated from github.com) commented 2024-05-03 04:35:57 +02:00

because it will create a new reference/new copy of connectionpool obj which would be different from network one.

because it will create a new reference/new copy of connectionpool obj which would be different from network one.
anand-skss (Migrated from github.com) reviewed 2024-05-03 04:37:49 +02:00
anand-skss (Migrated from github.com) commented 2024-05-03 04:37:49 +02:00

same reason as above, and other thing it is also throwing import error

same reason as above, and other thing it is also throwing import error
PeterSurda (Migrated from github.com) approved these changes 2024-05-09 09:37:06 +02:00
This repo is archived. You cannot comment on pull requests.
No description provided.