Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
Elixxir dApps SDK Swift
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mobile
iOS
Elixxir dApps SDK Swift
Commits
4cc1c04a
Commit
4cc1c04a
authored
2 years ago
by
Dariusz Rybicki
Browse files
Options
Downloads
Patches
Plain Diff
Add ConnectionCloser
parent
75de26d6
No related branches found
No related tags found
1 merge request
!2
Bindings API wrapper
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Sources/ElixxirDAppsSDK/Connection.swift
+7
-3
7 additions, 3 deletions
Sources/ElixxirDAppsSDK/Connection.swift
Sources/ElixxirDAppsSDK/ConnectionCloser.swift
+31
-0
31 additions, 0 deletions
Sources/ElixxirDAppsSDK/ConnectionCloser.swift
with
38 additions
and
3 deletions
Sources/ElixxirDAppsSDK/Connection.swift
+
7
−
3
View file @
4cc1c04a
...
...
@@ -5,6 +5,7 @@ public struct Connection {
public
var
getPartner
:
()
->
Data
public
var
send
:
MessageSender
public
var
listen
:
MessageListener
public
var
close
:
ConnectionCloser
}
extension
Connection
{
...
...
@@ -20,7 +21,8 @@ extension Connection {
return
data
},
send
:
.
live
(
bindingsConnection
:
bindingsConnection
),
listen
:
.
live
(
bindingsConnection
:
bindingsConnection
)
listen
:
.
live
(
bindingsConnection
:
bindingsConnection
),
close
:
.
live
(
bindingsConnection
:
bindingsConnection
)
)
}
...
...
@@ -36,7 +38,8 @@ extension Connection {
return
data
},
send
:
.
live
(
bindingsAuthenticatedConnection
:
bindingsAuthenticatedConnection
),
listen
:
.
live
(
bindingsAuthenticatedConnection
:
bindingsAuthenticatedConnection
)
listen
:
.
live
(
bindingsAuthenticatedConnection
:
bindingsAuthenticatedConnection
),
close
:
.
live
(
bindingsAuthenticatedConnection
:
bindingsAuthenticatedConnection
)
)
}
}
...
...
@@ -47,7 +50,8 @@ extension Connection {
isAuthenticated
:
{
fatalError
(
"Not implemented"
)
},
getPartner
:
{
fatalError
(
"Not implemented"
)
},
send
:
.
failing
,
listen
:
.
failing
listen
:
.
failing
,
close
:
.
failing
)
}
#endif
This diff is collapsed.
Click to expand it.
Sources/ElixxirDAppsSDK/ConnectionCloser.swift
0 → 100644
+
31
−
0
View file @
4cc1c04a
import
Bindings
public
struct
ConnectionCloser
{
public
var
close
:
()
->
Void
public
func
callAsFunction
()
{
close
()
}
}
extension
ConnectionCloser
{
public
static
func
live
(
bindingsConnection
:
BindingsConnection
)
->
ConnectionCloser
{
ConnectionCloser
(
close
:
bindingsConnection
.
close
)
}
public
static
func
live
(
bindingsAuthenticatedConnection
:
BindingsAuthenticatedConnection
)
->
ConnectionCloser
{
ConnectionCloser
(
close
:
bindingsAuthenticatedConnection
.
close
)
}
}
#if DEBUG
extension
ConnectionCloser
{
public
static
let
failing
=
ConnectionCloser
{
fatalError
(
"Not implemented"
)
}
}
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment