A threadpool for alice to use for policy publication network requests.

pull/2140/head
jMyles 2020-05-15 16:34:32 -07:00
parent ea78f4f81f
commit b22e6cc7b6
1 changed files with 8 additions and 0 deletions

View File

@ -24,6 +24,11 @@ from random import shuffle
import maya
import time
from twisted.python.threadpool import ThreadPool
from bytestring_splitter import BytestringKwargifier, BytestringSplittingError
from bytestring_splitter import BytestringSplitter, VariableLengthBytestring
from bytestring_splitter import BytestringKwargifier, BytestringSplitter, BytestringSplittingError, \
VariableLengthBytestring
from constant_sorrow import constants
@ -123,6 +128,9 @@ class Alice(Character, BlockchainPolicyAuthor):
if is_me:
self.m = m
self.n = n
self.publication_threadpool = ThreadPool(maxthreads=120, minthreads=20, name="Alice Policy Publication") # In the future, this value is perhaps best set to something like 3-4 times the optimal "high n", whatever we determine that to be.
self.publication_threadpool.start()
else:
self.m = STRANGER_ALICE
self.n = STRANGER_ALICE