duart38 / serverless-sockets Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v3.0
License: GNU General Public License v3.0
The default record definition is too broad and is preventing this behaviour.
Bonus: we could potentially make the type enforcement conditional by tricking typescript into thinking one config variable is static/readonly
--INSECURE.hostname string
error: Could not find module in store: file:///.........$doc.ts
Could be that I'm attempting to point to a local file
error: Uncaught (in promise) InvalidStateError: readyState not OPEN
s.send(SocketMessage.encode(Object.assign(data, { type: EventType.BROADCAST, payload: { ...data.payload } })))
^
at WebSocket.send (deno:ext/websocket/01_websocket.js:290:15)
at https://raw.githubusercontent.com/duart38/serverless-sockets/main/src/server/Socket.ts:98:11
at Set.forEach (<anonymous>)
at Function.broadcast (https://raw.githubusercontent.com/duart38/serverless-sockets/main/src/server/Socket.ts:96:24)
at https://raw.githubusercontent.com/duart38/serverless-sockets/main/src/server/EventHandler.ts:45:16
Presumably happening because we axed some try-catch blocks..
By pre-populating an import map file with say "ssocket/" we can allow end-devs to use this import within their plugs without having to remember the URLs
Currently there's no way to provide the init file when running from the cli
This makes IDE autocompletion a hassle
@grevend could you do this?
yielded message needs to allow a field which replaces default 'reply to sender' mechanism
import { Log } from "../components/Log.ts";
import { SocketMessage } from "../interface/message.ts";
import { ModuleGenerator } from "../interface/socketFunction.ts";
export async function* renameMe(message: SocketMessage, from: number): ModuleGenerator {
Log.info(`Message from ${from}, ${message.payload}`);
yield { // this is how you return values. you can also use to return keyword to exit early.
event: "Greet", // you may send back any event to the client side. it is up to them if they want to act upon it or not.
// type: EventType.BROADCAST, // uncomment this to send a broadcast event instead (sends message to all connected clients excluding the one that initiated)
payload: { // your can put anything in this one.
name: `Hello ${from}, i got your message`
}
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.