Skip to content

Commit

Permalink
Badgerati#376: Tweak to Readme, and change to forget pooling for now
Browse files Browse the repository at this point in the history
  • Loading branch information
Badgerati committed Sep 19, 2019
1 parent 65a0ed2 commit 7cc3ebd
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[![PowerShell](https://img.shields.io/powershellgallery/dt/pode.svg?label=PowerShell&colorB=085298)](https://www.powershellgallery.com/packages/Pode)
[![Docker](https://img.shields.io/docker/pulls/badgerati/pode.svg?label=Docker)](https://hub.docker.com/r/badgerati/pode/)

Pode is a Cross-Platform PowerShell framework for creating web servers to host [REST APIs](https://badgerati.github.io/Pode/Tutorials/Routes/Overview/), [Web Pages](https://badgerati.github.io/Pode/Tutorials/Routes/Examples/WebPages/), and [SMTP/TCP](https://badgerati.github.io/Pode/Tutorials/SmtpServer/) Servers. Pode also allows you to render dynamic files using [`.pode`](https://badgerati.github.io/Pode/Tutorials/Views/Pode/) files, which are just embedded PowerShell, or other [Third-Party](https://badgerati.github.io/Pode/Tutorials/Views/ThirdParty/) template engines. Plus many more features, including [Azure Functions](https://badgerati.github.io/Pode/Tutorials/Serverless/Types/AzureFunctions/) and [AWS Lambda](https://badgerati.github.io/Pode/Tutorials/Serverless/Types/AwsLambda/) support!
Pode is a Cross-Platform framework, *completely written in PowerShell*, for creating web servers to host [REST APIs](https://badgerati.github.io/Pode/Tutorials/Routes/Overview/), [Web Pages](https://badgerati.github.io/Pode/Tutorials/Routes/Examples/WebPages/), and [SMTP/TCP](https://badgerati.github.io/Pode/Tutorials/SmtpServer/) Servers. Pode also allows you to render dynamic files using [`.pode`](https://badgerati.github.io/Pode/Tutorials/Views/Pode/) files, which are just embedded PowerShell, or other [Third-Party](https://badgerati.github.io/Pode/Tutorials/Views/ThirdParty/) template engines. Plus many more features, including [Azure Functions](https://badgerati.github.io/Pode/Tutorials/Serverless/Types/AzureFunctions/) and [AWS Lambda](https://badgerati.github.io/Pode/Tutorials/Serverless/Types/AwsLambda/) support!

<p align="center">
<img src="https://github.com/Badgerati/Pode/blob/develop/images/example_code_2.png?raw=true" />
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![Code Coverage](https://coveralls.io/repos/github/Badgerati/Pode/badge.svg?branch=develop)](https://coveralls.io/github/Badgerati/Pode?branch=develop)
[![Gitter](https://badges.gitter.im/Badgerati/Pode.svg)](https://gitter.im/Badgerati/Pode?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

Pode is a Cross-Platform PowerShell framework to create web servers that host REST APIs, Web Sites, and TCP/SMTP Servers. It also allows you to render dynamic files using `.pode` files, which is effectively embedded PowerShell, or other Third-Party template engines. Pode also has support for middleware, sessions, authentication, and logging; as well as access and rate limiting features. There's also Azure Functions and AWS Lambda support!
Pode is a Cross-Platform framework, *completely written in PowerShell*, to create web servers that host REST APIs, Web Sites, and TCP/SMTP Servers. It also allows you to render dynamic files using `.pode` files, which is effectively embedded PowerShell, or other Third-Party template engines. Pode also has support for middleware, sessions, authentication, and logging; as well as access and rate limiting features. There's also Azure Functions and AWS Lambda support!

[![GetStarted](https://img.shields.io/badge/-Get%20Started!-green.svg?longCache=true&style=for-the-badge)](./Getting-Started/Installation)
[![QuickLook](https://img.shields.io/badge/-Quick%20Look!-blue.svg?longCache=true&style=for-the-badge)](#quick-look)
Expand Down
2 changes: 1 addition & 1 deletion examples/web-sockets.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Import-Module "$($path)/src/Pode.psm1" -Force -ErrorAction Stop
# Import-Module Pode

# create a server, and start listening
Start-PodeServer -Type Pode -Threads 2 {
Start-PodeServer -Type Pode -Threads 5 {

# listen
Add-PodeEndpoint -Address * -Port 8090 -Protocol Http
Expand Down
2 changes: 1 addition & 1 deletion packers/choco/pode.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<owners>Badgerati</owners>
<summary>Pode is a Cross-Platform PowerShell framework for creating web servers to host REST APIs and Websites.</summary>
<description>
Pode is a Cross-Platform PowerShell framework for creating web servers to host REST APIs and Websites. Pode also has support for being used in Azure Functions and AWS Lambda.
Pode is a Cross-Platform framework, completely written in PowerShell, for creating web servers to host REST APIs and Websites. Pode also has support for being used in Azure Functions and AWS Lambda.

### Features

Expand Down
2 changes: 1 addition & 1 deletion src/Private/Context.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function New-PodeContext
# set socket details for pode server
$ctx.Server.Sockets = @{
Listeners = @()
MaxConnections = 500
MaxConnections = 20
Queues = @{
Contexts = [System.Collections.Generic.List[hashtable]]::new(100)
Connections = [System.Collections.Concurrent.ConcurrentQueue[System.Net.Sockets.SocketAsyncEventArgs]]::new()
Expand Down
3 changes: 2 additions & 1 deletion src/Private/PodeServer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ function Start-PodeSocketServer
# start the listener events
if ($ThreadId -eq 1) {
Register-PodeSocketListenerEvents
Start-PodeSocketListener
}

Start-PodeSocketListener

while (!$PodeContext.Tokens.Cancellation.IsCancellationRequested)
{
# wait for a socket to be connected
Expand Down
1 change: 0 additions & 1 deletion src/Private/Server.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ function Restart-PodeInternalServer
$PodeContext.Server.Sockets.Listeners = @()
$PodeContext.Server.Sockets.Queues.Contexts.Clear()
$PodeContext.Server.Sockets.Queues.Connections.Clear()
$PodeContext.Server.Sockets.MaxConnections = 5000

# set view engine back to default
$PodeContext.Server.ViewEngine = @{
Expand Down
3 changes: 1 addition & 2 deletions src/Private/Sockets.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ function Close-PodeSocketListener

# close all open listeners and unbind events
for ($i = $PodeContext.Server.Sockets.Listeners.Length - 1; $i -ge 0; $i--) {
Unregister-Event -SourceIdentifier (Get-PodeSocketListenerConnectionEventName -Id $i) -Force
Close-PodeSocket -Socket $PodeContext.Server.Sockets.Listeners[$i].Socket -Shutdown
}

Expand Down Expand Up @@ -170,7 +169,7 @@ function Invoke-PodeSocketProcessAccept
Invoke-PodeSocketAccept -Listener $listener

# if not success, close this accept socket and accept again
if (($null -eq $accepted) -or ($Arguments.SocketError -ne [System.Net.Sockets.SocketError]::Success) -or ($accepted.Available -le 0)) {
if (($null -eq $accepted) -or ($Arguments.SocketError -ne [System.Net.Sockets.SocketError]::Success)) {
# close socket
if ($null -ne $accepted) {
$accepted.Close()
Expand Down

0 comments on commit 7cc3ebd

Please sign in to comment.