This commit is contained in:
parent
d733ba7da5
commit
f0dce8826b
2 changed files with 28 additions and 9 deletions
|
@ -235,6 +235,11 @@ pub fn processOneEvent(self: *Connection, state: anytype) !bool {
|
|||
cbptr.* = null;
|
||||
}
|
||||
},
|
||||
.Signal => |act| {
|
||||
if (@hasDecl(State, "signal")) {
|
||||
try state.signal(state, self, act);
|
||||
}
|
||||
},
|
||||
.Hello => return error.ProtocolViolation,
|
||||
}
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@ pub const calls = @import("proto/calls.zig");
|
|||
|
||||
pub const nu_target_version = std.SemanticVersion{
|
||||
.major = 0,
|
||||
.minor = 96,
|
||||
.patch = 0,
|
||||
.minor = 97,
|
||||
.patch = 1,
|
||||
};
|
||||
|
||||
pub const dbt = .{@import("blocks/union_de.zig")};
|
||||
|
@ -18,6 +18,7 @@ pub const Message = union(enum) {
|
|||
Call: Call,
|
||||
Goodbye,
|
||||
EngineCallResponse: struct { u64, EngineCallResponse },
|
||||
Signal: enum { Interrupt, Reset },
|
||||
|
||||
/// Casts this message to a specific message type and returns an error if it is different.
|
||||
pub fn cast(self: Message, comptime T: type) error{InvalidType}!T {
|
||||
|
@ -428,19 +429,32 @@ pub const EvaluatedCall = struct {
|
|||
|
||||
pub const PipelineDataHeader = union(enum) {
|
||||
Empty,
|
||||
Value: Value,
|
||||
Value: struct { Value, ?PipelineMetadata },
|
||||
ListStream: ListStreamInfo,
|
||||
ExternalStream: struct {
|
||||
span: Span = .{},
|
||||
stdout: ?RawStreamInfo,
|
||||
stderr: ?RawStreamInfo,
|
||||
exit_code: ?ListStreamInfo,
|
||||
trim_end_newline: bool = false,
|
||||
ByteStream: ByteStreamInfo,
|
||||
};
|
||||
|
||||
pub const PipelineMetadata = struct {
|
||||
data_source: union(enum) {
|
||||
Ls,
|
||||
HtmlThemes,
|
||||
FilePath: []const u8,
|
||||
None,
|
||||
},
|
||||
content_type: ?[]const u8 = null,
|
||||
};
|
||||
|
||||
pub const ListStreamInfo = struct {
|
||||
id: u64,
|
||||
span: Span,
|
||||
metadata: ?PipelineMetadata = null,
|
||||
};
|
||||
|
||||
pub const ByteStreamInfo = struct {
|
||||
id: u64,
|
||||
span: Span = .{},
|
||||
type: enum { Binary, String, Unknown },
|
||||
metadata: ?PipelineMetadata = null,
|
||||
};
|
||||
|
||||
pub const RawStreamInfo = struct {
|
||||
|
|
Loading…
Reference in a new issue