Skip to main content

Run on my cloud

Project description

Run on cloud with me

import pegasi
import time, math, requests

pwd="eat those french fries and drink cola"

dash = pegasi.Dash(pwd,api)

def hello_world(x="world"):
	return "Hello {}!".format(x)


def timey_wimey(x):
	return time.time()
print(,[1]*70)) #70 functions, each takes exactly 1 second all done at the same time

print(,test=True))#test=True means server shall not execute function, but just return it to you

print(,args=[1],save="timey_wimey")) #execute and save
print(,save="hello_world",test=True)) #save without executing

print(,load="timey_wimey",args=[1]))#now we can use function without sending it
print(,load="timey_wimey",args=[1]*70))#weven map

print( x: x*x/x+x,range(0,100))) # we can use lambda
#first response would be error because of division by zero

print(dash.filter(lambda t: t % 1 > 0.5,,load="timey_wimey",args=[1]*70))) #and filter
#For both map and filter you send only one request to the server and it applies multitasking request to itself

print( a,b: "{} and {}".format(a,b),[["A","B"],["R","B"],["R","D"]],star=True))

#if you have function that accepts more than one argument use star=True

#you can send get requests to trigger function from anywhere
#TODO: sending args through get requests

Project details

Download files

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

Source Distribution

pegasi-1.1.tar.gz (4.5 kB view hashes)

Uploaded source

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