I've recently been looking into the go concurrency model to see how it compares to asyncio.
An interesting concept caught my attention: go generators.
I've recently been looking into the go concurrency model to see how it compares to asyncio.
An interesting concept caught my attention: go generators.
You need to provide some classes and decorators yourself to maintain the same style as [email protected]
.
@EntityRepository(UserEntity)
export class UserRepository extends Repository<UserEntity> {}
↓
#![allow(unused)] // silence unused warnings while exploring (to comment out) | |
use std::{error::Error, time::Duration}; | |
use tokio::time::sleep; | |
use redis::{ | |
from_redis_value, | |
streams::{StreamRangeReply, StreamReadOptions, StreamReadReply}, | |
AsyncCommands, Client, | |
}; |
// Like interruptWhen / interrupt but allows resumption of the source stream. | |
def pauseWhen[F[_]: Async, A](controlSignal: Signal[F, Boolean]): Pipe[F, A, A] = | |
pause(controlSignal.discrete) | |
def pause[F[_]: Async, A](control: Stream[F, Boolean]): Pipe[F, A, A] = { | |
def unpaused( | |
controlFuture: ScopedFuture[F, Pull[F, Nothing, (NonEmptyChunk[Boolean], Handle[F, Boolean])]], | |
srcFuture: ScopedFuture[F, Pull[F, Nothing, (NonEmptyChunk[A], Handle[F, A])]] | |
): Pull[F, A, Nothing] = { |
package main | |
import ( | |
"fmt" | |
"github.com/aws/aws-sdk-go/aws" | |
"github.com/aws/aws-sdk-go/aws/session" | |
"github.com/aws/aws-sdk-go/service/ssm" | |
) |
package main | |
import ( | |
"net/http" | |
"database/sql" | |
"fmt" | |
"log" | |
"os" | |
) |
System: Debian/Ubuntu/Fedora. Might work for others as well.
As mentioned here, to update a go version you will first need to uninstall the original version.
To uninstall, delete the /usr/local/go
directory by:
@Entity | |
public class TreeCategory extends IdentifiableEntity { | |
.... | |
@ManyToOne(optional = true) | |
@JoinColumn(name = "parent_id", referencedColumnName = "id") | |
public TreeCategory getParent() { | |
return parent; | |
} |
location ~* "(eval\()" { deny all; } | |
location ~* "(127\.0\.0\.1)" { deny all; } | |
location ~* "([a-z0-9]{2000})" { deny all; } | |
location ~* "(javascript\:)(.*)(\;)" { deny all; } | |
location ~* "(base64_encode)(.*)(\()" { deny all; } | |
location ~* "(GLOBALS|REQUEST)(=|\[|%)" { deny all; } | |
location ~* "(<|%3C).*script.*(>|%3)" { deny all; } | |
location ~ "(\\|\.\.\.|\.\./|~|`|<|>|\|)" { deny all; } | |
location ~* "(boot\.ini|etc/passwd|self/environ)" { deny all; } | |
location ~* "(thumbs?(_editor|open)?|tim(thumb)?)\.php" { deny all; } |