diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-05-29 04:28:32 -0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-05-29 04:34:44 -0400 |
commit | 0ea603d96eeefa12095a713900ef645ed3ca2560 (patch) | |
tree | 0d073b266db7beac8f471256ddd689a18d4a7a00 /dispatch.go | |
parent | b6c0ad15fae9f747dbf91525caf6189beb358f76 (diff) |
Support using deno as a library
Diffstat (limited to 'dispatch.go')
-rw-r--r-- | dispatch.go | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/dispatch.go b/dispatch.go index a6308709e..a5728ad81 100644 --- a/dispatch.go +++ b/dispatch.go @@ -1,10 +1,9 @@ // Copyright 2018 Ryan Dahl <ry@tinyclouds.org> // All rights reserved. MIT License. -package main +package deno import ( "github.com/golang/protobuf/proto" - "github.com/ry/v8worker2" "sync" ) @@ -20,19 +19,10 @@ var stats struct { v8workerBytesRecv int } -// There is a single global worker for this process. -// This file should be the only part of deno that directly access it, so that -// all interaction with V8 can go through a single point. -var worker *v8worker2.Worker - var channels = make(map[string][]Subscriber) type Subscriber func(payload []byte) []byte -func createWorker() { - worker = v8worker2.New(recv) -} - func recv(buf []byte) (response []byte) { stats.v8workerRecv++ stats.v8workerBytesRecv += len(buf) |