-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from manatlan/feature/new_version_with_namedpipes
Feature/new version with namedpipes
- Loading branch information
Showing
33 changed files
with
769 additions
and
1,239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,3 +129,4 @@ dmypy.json | |
.pyre/ | ||
|
||
uid_*.ses | ||
poetry.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# To learn more about how to use Nix to configure your environment | ||
# see: https://developers.google.com/idx/guides/customize-idx-env | ||
{ pkgs, ... }: { | ||
# Which nixpkgs channel to use. | ||
channel = "stable-23.11"; # or "unstable" | ||
# Use https://search.nixos.org/packages to find packages | ||
packages = [ | ||
# pkgs.go | ||
pkgs.python311 | ||
pkgs.poetry | ||
pkgs.killall | ||
# pkgs.python311Packages.pip | ||
# pkgs.nodejs_20 | ||
# pkgs.nodePackages.nodemon | ||
]; | ||
# Sets environment variables in the workspace | ||
env = {}; | ||
idx = { | ||
# Search for the extensions you want on https://open-vsx.org/ and use "publisher.id" | ||
extensions = [ | ||
# "vscodevim.vim" | ||
]; | ||
# Enable previews | ||
previews = { | ||
enable = true; | ||
previews = { | ||
# web = { | ||
# # Example: run "npm run dev" with PORT set to IDX's defined port for previews, | ||
# # and show it in IDX's web preview panel | ||
# command = ["npm" "run" "dev"]; | ||
# manager = "web"; | ||
# env = { | ||
# # Environment variables to set for your server | ||
# PORT = "$PORT"; | ||
# }; | ||
# }; | ||
}; | ||
}; | ||
# Workspace lifecycle hooks | ||
workspace = { | ||
# Runs when a workspace is first created | ||
onCreate = { | ||
# Example: install JS dependencies from NPM | ||
# npm-install = "npm install"; | ||
}; | ||
# Runs when the workspace is (re)started | ||
onStart = { | ||
# Example: start a background task to watch and re-build backend code | ||
# watch-backend = "npm run watch-backend"; | ||
}; | ||
}; | ||
}; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
gunicorn -w 4 -k uvicorn.workers.UvicornWorker -b localhost:8000 --preload main:app | ||
gunicorn -w 4 -k uvicorn.workers.UvicornWorker -b localhost:8000 --preload examples.main:app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
uvicorn.exe main:app --workers 4 | ||
uvicorn.exe examples.main:app --workers 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
|
||
# -*- coding: utf-8 -*- | ||
|
||
# a classic app, which is runned here with htag.Runner ! | ||
# btw this app is used in a htagweb context, thru pytest | ||
|
||
from htag import Tag | ||
import asyncio,time | ||
|
||
class App(Tag.body): | ||
statics="body {background:#EEE;}" | ||
|
||
def init(self): | ||
self.place = Tag.div() | ||
asyncio.ensure_future( self.loop_timer() ) | ||
self <= "Hello World" | ||
self <= self.place | ||
self <= Tag.button("exit", _onclick=lambda ev: self.exit()) | ||
self <= Tag.button("Say hi", _onclick=self.sayhi) | ||
|
||
async def sayhi(self,ev): | ||
self <= "hi!" | ||
|
||
async def loop_timer(self): | ||
while 1: | ||
await asyncio.sleep(0.5) | ||
self.place.clear(time.time() ) | ||
if not await self.place.update(): # update component using current websocket | ||
# break if can't (<- good practice to kill this asyncio/loop) | ||
break | ||
|
||
#================================================================================= | ||
from htag.runners import Runner | ||
|
||
if __name__ == "__main__": | ||
|
||
# import logging | ||
# logging.basicConfig(format='[%(levelname)-5s] %(name)s: %(message)s',level=logging.INFO) | ||
# logging.getLogger("htag.tag").setLevel( logging.INFO ) | ||
# logging.getLogger("htag.render").setLevel( logging.INFO ) | ||
|
||
|
||
Runner(App).run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.