如果没有.once调用,这将起作用。
我正在尝试从服务器端代码发送一条消息
io.on('connect', function (socket) {
socket.once('connect', function() {
socket.emit('mydata', { feed: result});
但是除非删除第二行,否则我什么都不会在客户端得到。我也尝试过socket.once('mydata',{feed:result})但:
throw new TypeError('listener must be a function');
Run Code Online (Sandbox Code Playgroud)
换句话说,只有当存在新的“ mydata”时,如何才能将消息发送到客户端?
谢谢
这是我通常做的:
$ git add . -Av
$ git commit -m "I want this to be master"
Run Code Online (Sandbox Code Playgroud)
但是当我尝试推送到远程时,“一切都是最新的”并且最新的提交不是主提交。
$ git branch
* (HEAD detached from f0efe1a)
added_mongodb_auth
master
serviceworkers_branch
Run Code Online (Sandbox Code Playgroud)
我怎样才能让最新的提交成为大师?
我将通过以下链接完成步骤 3:将 Docker 映像推送到 Container Registry,了解如何设置从 Google Cloud Engine 到 Kubernetes 引擎的 Docker 映像:
$
docker push gcr.io/${PROJECT_ID}/modo:v1
The push refers to repository [gcr.io/6267453573146657250/modo]
6a2e5ee87a10: Preparing
a276c90a34a4: Preparing
d675dcbcf549: Preparing
d675dcbcf549: Retrying in 1 second
0829f83db381: Retrying in 1 second
db7b61b8aab8: Retrying in 5 seconds
c5b2ac536264: Waiting
6c08a5b7d8f4: Waiting
c5b2ac536264: Waiting
6c08a5b7d8f4: Waiting
50867bb8f5d7: Waiting
72d6c6f0ea06: Waiting
8686c6b8d999: Waiting
44b57351135e: Waiting
00b029f9aa09: Waiting
18f9b4e2e1bc: Waiting
unknown: Project 'modo:6267453573146657250' not found or deleted.
Run Code Online (Sandbox Code Playgroud)
我确信 ID“6267453573146657250”是有效的,因为它是我在云引擎上的唯一项目。
docker google-cloud-platform kubernetes google-kubernetes-engine