Skip to main content

Threaded Proxy Object

Project description

Threaded Proxy Object

pip install threadproxyobject

Tested against Windows 10 / Python 3.11 / Anaconda

import pandas as pd
import random
from time import sleep
from threadedproxyobject import ThreadedProxyObject, ThreadedProxyObjectMultiExecute


def funct(x, y):
    return random.randint(x, y)


def funct2(x, y):
    return [x + y]


def funct3(x, y):
    while True:
        print(random.randint(x, y))
        sleep(1)


test = ThreadedProxyObject(funct, args=(1, 200))
test.start()
print(test)
sleep(1)
print((test) ** 10)

test2 = ThreadedProxyObject(funct2, args=(1, 200))
test2.start()
print((test2))
sleep(1)
test2.append(3)
print(test2)

test3 = ThreadedProxyObjectMultiExecute(fu=funct, args=(1, 200))
test3()
print((test3))
sleep(1)
print(test3 / 10)

test4 = ThreadedProxyObjectMultiExecute(fu=funct2, args=(1, 200))
test4()
sleep(1)
print(test4 * 10)

test5 = ThreadedProxyObjectMultiExecute(fu=funct3, args=(1, 200))
test5()
print((test5))
test5.kill()
test6 = ThreadedProxyObjectMultiExecute(fu=funct, daemon=False, args=(1, 200))
test6.start_timer_call(3)
sleep(4)
print((test6))
print(test6 + 10)
test6.stop_timer_call()


liste = [
    ThreadedProxyObjectMultiExecute(
        fu=funct, daemon=True, args=(1, 200)
    ).start_timer_call(3)
    for x in range(100)
]
sleep(2)
df = pd.DataFrame(liste)
print(df[0] * 2)

# 45
# 34050628916015625
# [201]
# [201, 3]
# 129
# 12.9
# [201, 201, 201, 201, 201, 201, 201, 201, 201, 201]
# 141
# N/A
# 151
# 161
# 0     128
# 1     314
# 2     220
# 3     102
# 4     220
#      ... 
# 95     72
# 96    314
# 97     24
# 98    144
# 99     24
# Name: 0, Length: 100, dtype: object

Project details


Release history Release notifications | RSS feed

This version

0.10

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

threadedproxyobject-0.10.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

threadedproxyobject-0.10-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file threadedproxyobject-0.10.tar.gz.

File metadata

  • Download URL: threadedproxyobject-0.10.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for threadedproxyobject-0.10.tar.gz
Algorithm Hash digest
SHA256 930fa60fd67de866d25f138af23e777c6949fb073d6b2362714207c903f3b0fc
MD5 ff28597f845f9e6f69aa36b411cf1948
BLAKE2b-256 c72af5bbd842f0c14265a605b44e4e39879f6776b07818e2f9e24c1a4afc5922

See more details on using hashes here.

File details

Details for the file threadedproxyobject-0.10-py3-none-any.whl.

File metadata

File hashes

Hashes for threadedproxyobject-0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 5f9f246339fc0679eea41796933b7a61cd40b2cb2f6f81a734c575aa6420cd89
MD5 816cbf1a4d71057a15ae840de7154629
BLAKE2b-256 8bb7ff599ca4014b002edee4786c0022c215c33cb2051a29493bb942d8516f97

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page