-
Notifications
You must be signed in to change notification settings - Fork 1
/
job.linux.go
52 lines (40 loc) · 1.1 KB
/
job.linux.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// +build linux
package elio
//import (
// "golang.org/x/sys/unix"
//)
// // Work work
// func (j *WriteJob) Work() error {
// var err error
// var out []byte
// var written int
// outs := j.session.outQueue.Fetch()
// for _, o := range outs {
// out = append(out, o.(*ByteBuffer).Bytes()...)
// PutByteBuffer(o.(*ByteBuffer))
// }
// l := len(out)
// for written < l {
// var w int
// w, err = j.session.service.io.Write(j.session, out[written:])
// if 0 < w {
// written += w
// } else {
// if (unix.EAGAIN == err) || (unix.EWOULDBLOCK == err) {
// if written < l {
// b := GetByteBuffer()
// b.Write(out[written:])
// j.session.outQueue.Prepend(b)
// w := &WriteJob{session: j.session}
// j.session.service.io.Trigger(w)
// }
// } else {
// //AppgError().Str(LogObject, j.String()).Str(LogSession, j.session.String()).
// AppError().Str(LogSession, j.session.String()).
// Err(err).Msgf("writing failed with fd:%v written:%d w:%d count.outqueue:%d", j.session.fd, written, w, l)
// }
// break
// }
// }
// return err
// }